-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-16990][table-planner-blink] Support LookupTableSource in blink planner #12047
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 b718cd9 (Sat May 09 03:12:28 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:
|
| private final int[][] lookupKeys; | ||
|
|
||
| public LookupRuntimeProviderContext(int[][] lookupKeys) { | ||
| this.lookupKeys = lookupKeys; |
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.
Why is lookupKeys two-dimensional array.
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.
See the Javadoc org.apache.flink.table.connector.source.LookupTableSource.Context#getKeys, it is in order to support nested lookup keys.
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.
But IMO, two-dimensional array is not enough, what if there is a column a.b.c ?
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 can be expressed. If we have a lookup table , and the lookup key is r.f.q2
CREATE TABLE t1 (r ROW< d DOUBLE, f ROW<q1 STRING, q2 BOOLEAN> >);the array will be [[0, 1, 1]] which is equivalent to [["r", "f", "q2"]].
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.
The array is a path for selection.
|
|
||
| public static final String IDENTIFIER = "values"; | ||
| public static final AtomicInteger RESOURCE_COUNTER = new AtomicInteger(); | ||
|
|
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.
What is this used for ?
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 is used for checking open and close are both invocked. The RESOURCE_COUNTER will be checked in https://github.com/apache/flink/pull/12047/files#diff-46716d3945346195315abf04aa338171R79
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 explanation.
|
The build CI is passed except a python test failed which is related to FLINK-17597. |
danny0405
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.
+1, I have no other objections now, except that there are many if else clause for the legacy planner, I think they are to be cleaned soon once we upgrade to the new connector totally.
|
Thanks for the reviewing @danny0405 . Yes, they can be cleaned once legacy source is removed. |
What is the purpose of the change
Support the
LookupTableSourceinterface in planner.Brief change log
Update
CommonLookupJointo both handling legacyLookupableTableSourceand newLookupTableSource. We didn't copy a LegacyCommonLookupJoin, because there are too many code can be reused.Verifying this change
LookupJoinTestandLookupJoinITCaseto beParameterized, and test both on legacy lookup and new lookup interface.Does this pull request potentially affect one of the following parts:
@Public(Evolving): yesDocumentation