-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[SQL] Alter Catalog and Table statements #36571
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
base: master
Are you sure you want to change the base?
Conversation
|
Assigning reviewers: R: @Abacn for label java. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
/gemini review |
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.
Code Review
This pull request introduces support for ALTER CATALOG and ALTER TABLE statements in Beam SQL, which is a significant feature addition. The changes are extensive, spanning the SQL parser, DDL execution logic, and the Iceberg IO connector. The implementation is well-structured and accompanied by a comprehensive set of tests for the new functionality.
My review has identified a functional bug in the unparse logic for ALTER TABLE, a potential thread-safety issue in the Iceberg catalog configuration, and an opportunity for code simplification by removing duplicated logic. After addressing these points, this pull request will be in excellent shape.
...tensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/parser/SqlAlterTable.java
Show resolved
Hide resolved
...g/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/iceberg/IcebergCatalog.java
Show resolved
Hide resolved
...nsions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/parser/SqlAlterCatalog.java
Outdated
Show resolved
Hide resolved
|
Reminder, please take a look at this pr: @Abacn |
|
assign to next reviewer |
|
Assigning reviewers: R: @kennknowles for label java. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
Reminder, please take a look at this pr: @kennknowles |
|
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @Abacn for label java. Available commands:
|
|
/gemini review |
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.
Code Review
This pull request introduces ALTER CATALOG and ALTER TABLE statements to Beam SQL, enhancing DDL capabilities. The changes include new parser rules, DDL node classes, and interface methods to support these operations. Specific implementations are provided for Iceberg catalogs and tables, as well as a test table provider. The new functionality allows modifying catalog properties, and for tables, it supports updating properties, schema (adding/dropping columns), and partition specifications. Comprehensive unit tests have been added to validate the new features, including a specific test for the limitation of not adding required columns to existing Iceberg tables. The code is well-structured and follows good practices for extensibility.
| Map<String, String> properties = | ||
| TableUtils.getObjectMapper() | ||
| .convertValue(table.getProperties(), new TypeReference<Map<String, String>>() {}); | ||
| ; |
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.
|
Reminder, please take a look at this pr: @Abacn |
|
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @chamikaramj for label java. Available commands:
|
|
Reminder, please take a look at this pr: @chamikaramj |
|
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @Abacn for label java. Available commands:
|
Addresses #35637
Adds the following features:
Modify a catalog's properties
Modify a table's properties, schema, or partition spec
Limitations: