Skip to content

Conversation

fsk119
Copy link
Member

@fsk119 fsk119 commented Dec 28, 2022

What is the purpose of the change

Introduce TableChange to represend ALTER TABLE ADD syntax.

Brief change log

  • Add TableChange pojo class
  • AlterSchemaConverter build the TableChange

Verifying 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:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 28, 2022

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@fsk119 fsk119 force-pushed the add branch 2 times, most recently from e3e2ee9 to 3d2ecc8 Compare December 28, 2022 14:15
Copy link
Contributor

@LadyForest LadyForest left a 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.

newProperties,
catalogTable.getComment()));
catalogTable.getComment());
if (addReplaceColumns.isReplace()) {
Copy link
Contributor

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?

Copy link
Member Author

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.

[1] https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Add/ReplaceColumns

Co-authored-by: Jane Chan <55568005+LadyForest@users.noreply.github.com>
@fsk119
Copy link
Member Author

fsk119 commented Dec 30, 2022

@flinkbot run azure

Copy link
Contributor

@LadyForest LadyForest left a 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 :)

@fsk119 fsk119 closed this in 5c3658a Dec 30, 2022
chucheng92 pushed a commit to chucheng92/flink that referenced this pull request Feb 3, 2023
akkinenivijay pushed a commit to krisnaru/flink that referenced this pull request Feb 11, 2023
@fsk119 fsk119 deleted the add branch March 20, 2023 02:02
Tan-JiaLiang pushed a commit to Tan-JiaLiang/flink that referenced this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants