-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Multi-stage] Allow filter for lookup JOIN #14523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Multi-stage] Allow filter for lookup JOIN #14523
Conversation
3cf68fa to
de41d59
Compare
de41d59 to
4652829
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14523 +/- ##
============================================
+ Coverage 61.75% 63.94% +2.19%
- Complexity 207 1569 +1362
============================================
Files 2436 2675 +239
Lines 133233 146975 +13742
Branches 20636 22559 +1923
============================================
+ Hits 82274 93981 +11707
- Misses 44911 46063 +1152
- Partials 6048 6931 +883
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
| RelOptUtil.classifyFilters(join, | ||
| aboveFilters, | ||
| joinType.canPushIntoFromAbove(), | ||
| joinType.canPushLeftFromAbove(), | ||
| canPushRight && joinType.canPushRightFromAbove(), | ||
| joinFilters, | ||
| leftFilters, | ||
| rightFilters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we can contribute a patch in Calcite where FilterJoinRule calls an instance method to do this so we could just extend it.
Something like:
public class FilterJoinRule extends ... {
boolean classifyFilters(
RelNode joinRel,
List<RexNode> filters,
JoinRelType relType,
List<RexNode> joinFilters,
List<RexNode> leftFilters,
List<RexNode> rightFilters) {
RelOptUtil.classifyFilters(join,
aboveFilters,
joinType.canPushIntoFromAbove(),
joinType.canPushLeftFromAbove(),
joinType.canPushRightFromAbove(),
joinFilters,
leftFilters,
rightFilters);
}
}So we could simplify this class by overriding that method and adding there our check.
Customize the following 2 rules to not push down filters/transforms for lookup JOIN:
CoreRules.FILTER_INTO_JOINandCoreRules.JOIN_CONDITION_PUSH: Do not push down filter to right table, but allow pushing down to left tableCoreRules.PROJECT_JOIN_TRANSPOSE: Disable the rule for lookup JOINTODO: Allow transpose to left table in
CoreRules.PROJECT_JOIN_TRANSPOSE