-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-22063][table] Fix bug that some join conditions are lost when … #15533
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
…building Lookup Join ExecNode
|
@leonardBang Please have a look at this. |
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit d5d2090 (Fri May 28 09:06:18 UTC 2021) 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:
|
leonardBang
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.
@cshuo Thanks for the fix, the PR looks good, could you help update the note and rebase to latest mater?
| input.getRowType, | ||
| calcOnTemporalTable, | ||
| allLookupKeys.keys.toList.sorted.toArray, | ||
| allLookupKeys.values.toList, |
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.
minor: could you help update the comment to
remaining condition used to filter the joined records (left input record X lookup-ed records)
|
The failed test is not related to this PR, cc @JingsongLi could you help merge? |
|
@cshuo Please add some comments to explain why |
JingsongLi
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.
Looks good to me.
…building Lookup Join ExecNode
What is the purpose of the change
Fix bug that some join conditions are lost when building remaining condition of LookupJoin.
Root Cause:
Considering the join key pairs are
l.a = r.e and l.b = r.e, we useMap<lookup_key, left_key>asallLookupKeysinformation, because lookup keys should be deduplicated. In this case we get<r.e, l.a>.When building remaining conditions, the expected remaining condition should be
l.b = r.e, but currently, we check whether the right key of key-pairs is inallLookupKeys, which leading to an empty result. This can be fixed by checking left key ofkey-pairs instead.
Brief change log
CommonPhysicalLookupJoinwhen buildingremainingConditionVerifying this change
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation