-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-30495][table-api] Introduce TableChange to represent ADD change #21566
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
e3e2ee9
to
3d2ecc8
Compare
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! The PR looks pretty good and I just left some minor comments.
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/TableChange.java
Outdated
Show resolved
Hide resolved
...able-planner/src/main/java/org/apache/flink/table/planner/utils/OperationConverterUtils.java
Show resolved
Hide resolved
newProperties, | ||
catalogTable.getComment())); | ||
catalogTable.getComment()); | ||
if (addReplaceColumns.isReplace()) { |
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.
Could you explain more about why differentiate add/replace operations?
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.
Because ALTER TABLE REPLACE
syntax may also remove all columns before.
For example, "ALTER TABLE test_change REPLACE COLUMNS (a int, b int);" will remove column 'c' from test_change's schema.[1]
So I think we can support this after introducing DROP change.
...le-planner/src/main/java/org/apache/flink/table/planner/operations/AlterSchemaConverter.java
Outdated
Show resolved
Hide resolved
...le-planner/src/main/java/org/apache/flink/table/planner/operations/AlterSchemaConverter.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Jane Chan <55568005+LadyForest@users.noreply.github.com>
@flinkbot run azure |
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 :)
This closes apache#21566 (cherry picked from commit 5c3658a)
What is the purpose of the change
Introduce TableChange to represend ALTER TABLE ADD syntax.
Brief change log
AlterSchemaConverter
build the TableChangeVerifying this change
Please make sure both new and modified tests in this PR follows the conventions defined in our code quality guide: https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
This change is already covered by existing tests, such as SqlToOperationConverterTest.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation