Skip to content

Commit

Permalink
Support filter in cross join elimination
Browse files Browse the repository at this point in the history
  • Loading branch information
Dandandan committed Oct 20, 2024
1 parent 228d747 commit a25b3fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datafusion/optimizer/src/eliminate_cross_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ impl OptimizerRule for EliminateCrossJoin {
}

if !all_filters.is_empty() {
// Add any filters on top - PushDownFilter can push filters down to applicable join
let first = all_filters.swap_remove(0);
let predicate = all_filters.into_iter().fold(first, and);
left = LogicalPlan::Filter(Filter::try_new(predicate, Arc::new(left))?);
Expand Down Expand Up @@ -223,7 +224,6 @@ fn flatten_join_inputs(
) -> Result<()> {
match plan {
LogicalPlan::Join(join) if join.join_type == JoinType::Inner => {
// checked in can_flatten_join_inputs
if let Some(filter) = join.filter {
all_filters.push(filter);
}
Expand Down

0 comments on commit a25b3fd

Please sign in to comment.