Skip to content

Commit

Permalink
style: code format
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Sep 23, 2023
1 parent c26cb66 commit 654e75e
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/optimizer/rule/pushdown_predicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,23 @@ impl Rule for PushPredicateIntoScan {

if let Some(mut binary) = option.take() {
binary.scope_aggregation()?;
let mut scan_by_index = child_op.clone();

scan_by_index.index_by = Some((meta.clone(), binary.rearrange()?));

// The constant expression extracted in prewhere is used to
// reduce the data scanning range and cannot replace the role of Filter.
graph.replace_node(
child_id,
OptExprNode::OperatorRef(
Operator::Scan(scan_by_index)
)
);

return Ok(())
let rearrange_binaries = binary.rearrange()?;

if !rearrange_binaries.is_empty() {
let mut scan_by_index = child_op.clone();
scan_by_index.index_by = Some((meta.clone(), rearrange_binaries));

// The constant expression extracted in prewhere is used to
// reduce the data scanning range and cannot replace the role of Filter.
graph.replace_node(
child_id,
OptExprNode::OperatorRef(
Operator::Scan(scan_by_index)
)
);

return Ok(())
}
}
}
}
Expand Down

0 comments on commit 654e75e

Please sign in to comment.