Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
costin committed Dec 13, 2024
1 parent e8cbe94 commit b6ab3fb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected LogicalPlan rule(Filter filter) {
return plan;
}

private record ScopedFilter(List<Expression> leftFilters, List<Expression> rightFilters, List<Expression> commonFilters) {}
private record ScopedFilter(List<Expression> commonFilters, List<Expression> leftFilters, List<Expression> rightFilters) {}

// split the filter condition in 3 parts:
// 1. filter scoped to the left
Expand All @@ -100,11 +100,11 @@ private static ScopedFilter scopeFilter(List<Expression> filters, LogicalPlan le
AttributeSet leftOutput = left.outputSet();
AttributeSet rightOutput = right.outputSet();

// first remove things that left scoped only
// first remove things that are left scoped only
rest.removeIf(f -> f.references().subsetOf(leftOutput) && leftFilters.add(f));
// followed by right scoped only
rest.removeIf(f -> f.references().subsetOf(rightOutput) && rightFilters.add(f));
return new ScopedFilter(leftFilters, rightFilters, rest);
return new ScopedFilter(rest, leftFilters, rightFilters);
}

private static LogicalPlan pushDownPastJoin(Filter filter, Join join) {
Expand Down

0 comments on commit b6ab3fb

Please sign in to comment.