-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder #13837
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
Conversation
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 247a8b4 (Thu Oct 29 07:27:38 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. DetailsThe Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
godfreyhe
left a comment
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.
Thanks for the contribution @tsreaper, I left a few comments.
| PREDICATE_SIMPLIFY_EXPRESSION_RULES.asScala ++ | ||
| FILTER_RULES.asScala | ||
| FILTER_RULES.asScala ++ | ||
| RuleSets.ofList(JoinDeriveNullFilterRule.INSTANCE).asScala |
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.
It's better we do not put JoinDeriveNullFilterRule into JOIN_COND_EQUAL_TRANSFER_RULES collection, instead I suggest we can add a program into JOIN_REWRITE stage after JOIN_COND_EQUAL_TRANSFER_RULES
| util.addTableSource("T6", types, Array("a6", "b6", "c6"), FlinkStatistic.builder() | ||
| .tableStats(new TableStats(500000L, Map( | ||
| "a6" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null), | ||
| "b6" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null), | ||
| "c6" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null) | ||
| ))).build()) | ||
|
|
||
| util.addTableSource("T7", types, Array("a7", "b7", "c7"), FlinkStatistic.builder() | ||
| .tableStats(new TableStats(500000L, Map( | ||
| "a7" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null), | ||
| "b7" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null), | ||
| "c7" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null) | ||
| ))).build()) | ||
|
|
||
| util.addTableSource("T8", types, Array("a8", "b8", "c8"), FlinkStatistic.builder() | ||
| .tableStats(new TableStats(500000L, Map( | ||
| "a8" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null), | ||
| "b8" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null), | ||
| "c8" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null) | ||
| ))).build()) |
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.
if they are only used in one test method, we can move them into the specific method
| .tableStats(new TableStats(500000L, Map( | ||
| "a6" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null), | ||
| "b6" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null), | ||
| "c6" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null) |
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.
please do not use deprecated constructor
| FILTER_RULES.asScala | ||
| ).asJava) | ||
|
|
||
| val JOIN_NULL_FILTER_RULES: RuleSet = RuleSets.ofList( |
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.
It's better JOIN_PREDICATE_REWRITE_RULES could reuse this rule set
godfreyhe
left a comment
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.
Thanks for the update, LGTM
|
@flinkbot run azure |
What is the purpose of the change
JoinDeriveNullFilterRulewill filter out null join keys to prevent data skew for joins. Currently this rule is only applied before join reorder. After join reorder the join keys for some inputs might change and we need to apply this rule again.This PR applies the rule again after join reorder.
Brief change log
JoinDeriveNullFilterRuleafter join reorderVerifying this change
This change added tests and can be verified by running the added tests.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation