Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzl25 committed Sep 14, 2023
1 parent 9a4c04d commit c2bf6ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/frontend/src/optimizer/plan_node/generic/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use std::rc::Rc;

use educe::Educe;
use fixedbitset::FixedBitSet;
use itertools::Itertools;
use pretty_xmlish::Pretty;
use risingwave_common::catalog::{ColumnDesc, Field, Schema, TableDesc};
use risingwave_common::util::column_index_mapping::ColIndexMapping;
Expand Down
23 changes: 12 additions & 11 deletions src/frontend/src/optimizer/plan_node/logical_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,18 @@ impl LogicalScan {
return (self.core.clone(), Condition::true_cond(), None);
}

let mut mapping = ColIndexMapping::with_target_size(
self.required_col_idx().iter().map(|i| Some(*i)).collect(),
self.table_desc().columns.len(),
);
// Since `required_col_idx` mapping is not invertible, we need to inverse manually.
let mut inverse_map = vec![None; mapping.target_size()];
for (src, dst) in mapping.mapping_pairs() {
inverse_map[dst] = Some(src);
}
let mut inverse_mapping =
ColIndexMapping::with_target_size(inverse_map, mapping.source_size());
let mut inverse_mapping = {
let mapping = ColIndexMapping::with_target_size(
self.required_col_idx().iter().map(|i| Some(*i)).collect(),
self.table_desc().columns.len(),
);
// Since `required_col_idx` mapping is not invertible, we need to inverse manually.
let mut inverse_map = vec![None; mapping.target_size()];
for (src, dst) in mapping.mapping_pairs() {
inverse_map[dst] = Some(src);
}
ColIndexMapping::with_target_size(inverse_map, mapping.source_size())
};

predicate = predicate.rewrite_expr(&mut inverse_mapping);

Expand Down

0 comments on commit c2bf6ac

Please sign in to comment.