-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-17103][table-planner-blink] Supports dynamic options for Blink… #11711
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
… planner * Implement dynamic options in Blink planner * Implement CSV connector * Add plan test OptionsHintTest * Add a Csv ITCase in CatalogTableITCase
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit bffb4b0 (Mon Apr 13 05:19:59 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:
|
|
|
||
| /** | ||
| * This class holds {@link org.apache.flink.configuration.ConfigOption}s used by | ||
| * Flink's BLINK table planner. |
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.
Not necessary to emphasize this
| * | ||
| * @return a new copy of this table with replaced table options | ||
| */ | ||
| CatalogTable copy(Map<String, String> options); |
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.
use properties to be aligned with other places?
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.
As discussed in the mailing list, options is our new preference to describe the table properties.
|
|
||
| @Override | ||
| public CatalogTable copy(Map<String, String> options) { | ||
| throw new UnsupportedOperationException("ConnectorCatalogTable cannot copy with new table options"); |
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.
Should we also support the path of TableEnvironment.connect to specify table option?
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.
All the table translating through CatalogTableImpl can have valid dynamic table options, including the table from TableEnvironment.connect. There is no way for a ConnectorCatalogTable to override table options because the table source is already there.
| private final Map<String, String> staticPartitions; | ||
| private final QueryOperation child; | ||
| private final boolean overwrite; | ||
| private final List<?> tableHints; |
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 use List<?>?
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 module flink-table-api-java has no Calcite as dependency, use List<?> instead of List to fix the compiler warnings.
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.
I think we need to extract useful information from List and place it here.
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 RelHint itself is a POJO which has hint name and hint options as attributes, passing through these RelHints and hand-over them to planner for specific manipulation can simplify the codes.
But i'm also fine if we pre-process these RelHints and extract the contents we care about, such as the dynamic options or some other attributes (index in the future) directly in CatalogSinkModifyOperation.
KurtYoung
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.
Mostly LGTM, only 2 minor comments.
|
|
||
| val query = | ||
| """ | ||
| |INSERT INTO T2 /*+ OPTIONS('format.field-delimiter' = ',') */ |
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.
, is actually the default delimiter even if you didn't configure it. Use another one to make sure this take affect.
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.
Agree, thanks.
| } else { | ||
| // Add the dynamic options as part of the table digest, | ||
| // this is a temporary solution, we expect to avoid this | ||
| // before Calcite 1.23.0. |
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.
Create an issue to track this?
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, i have fired a issue https://issues.apache.org/jira/browse/FLINK-17147
KurtYoung
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.
LGTM, and I played with this feature in sql cli and it works nicely.
… planner
What is the purpose of the change
Supports syntax "table /*+ OPTIONS('k1'='v1', 'k2'='v2') */" to specify dynamic options within the scope of the appended table.
Brief change log
Verifying this change
See ITCases and UT tests in the patch.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): yesDocumentation