Skip to content

Conversation

@ahmedabu98
Copy link
Contributor

@ahmedabu98 ahmedabu98 commented Oct 20, 2025

Addresses #35637

Adds the following features:

Modify a catalog's properties

ALTER CATALOG my_catalog 
[ RESET ('prop1', 'prop2', ...) ] 
[ SET ('prop5'='val5', 'prop6'='val6', ...) ]

Modify a table's properties, schema, or partition spec

ALTER TABLE my_table
[ DROP COLUMNS (col1, col2, ...) ]
[ ADD COLUMNS (col5 VARCHAR COMMENT 'some-comment', col6 INTEGER, ...) ]
[ DROP PARTITIONS ('col1', 'month(col4)', ...) ]
[ ADD PARTITIONS ('truncate(col5, 3)', 'col4', ...) ]
[ RESET ('prop1', 'prop2', ...) ] 
[ SET ('prop5'='val5', 'prop6'='val6', ...) ]

Limitations:

  • Does not support adding a required/non-null column to an Iceberg table (introduced in V3). Iceberg requires such a column to specify a default value (so that existing rows can adapt that value to their new column), but Beam Schemas do not support a "default value"

@github-actions github-actions bot added the io label Nov 11, 2025
@ahmedabu98 ahmedabu98 marked this pull request as ready for review November 11, 2025 20:12
@github-actions
Copy link
Contributor

Assigning reviewers:

R: @Abacn for label java.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@ahmedabu98
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@github-actions
Copy link
Contributor

Reminder, please take a look at this pr: @Abacn

@Abacn
Copy link
Contributor

Abacn commented Nov 21, 2025

assign to next reviewer

@github-actions
Copy link
Contributor

Assigning reviewers:

R: @kennknowles for label java.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@github-actions
Copy link
Contributor

Reminder, please take a look at this pr: @kennknowles

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @Abacn for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@ahmedabu98
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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>>() {});
;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a redundant semicolon at the end of this line.

                .convertValue(table.getProperties(), new TypeReference<Map<String, String>>() {});

@github-actions
Copy link
Contributor

Reminder, please take a look at this pr: @Abacn

@github-actions
Copy link
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @chamikaramj for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@github-actions
Copy link
Contributor

Reminder, please take a look at this pr: @chamikaramj

@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2026

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @Abacn for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

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.

2 participants