[FLINK-39662][table] Support ALTER MATERIALIZED TABLE ... SET (...) conversion#28163
Merged
Conversation
Contributor
Author
|
@flinkbot run azure |
snuyanzin
reviewed
May 16, 2026
snuyanzin
reviewed
May 16, 2026
snuyanzin
reviewed
May 16, 2026
snuyanzin
reviewed
May 18, 2026
snuyanzin
approved these changes
May 18, 2026
Contributor
|
LGTM |
…onversion
The parser already accepted `ALTER MATERIALIZED TABLE t SET ('k' = 'v')`, but the planner had no converter registered for `SqlAlterMaterializedTableOptions`. As a result, the statement was rejected at plan time with `TableException: Unsupported query`.
Add `SqlAlterMaterializedTableOptionsConverter` and register it in `SqlNodeConverters#registerMaterializedTableConverters`. The converter emits an `AlterMaterializedTableChangeOperation` with one `TableChange.set(key, value)` per option provided. Merge with existing options is handled by `MaterializedTableChangeHandler.setTableOption`, which mirrors the create-or-alter path established in FLINK-39199.
Planner-level tests cover the success path, single-option summary string, unknown table, and applying SET to a regular table. A gateway IT test exercises the end-to-end flow in FULL refresh mode where the change is applied directly to the catalog. The user-facing docs are updated for the new SET clause.
Spell out the behavior for duplicate keys (last value wins, applied in statement order) and the empty option list (rejected). Add a corresponding example.
snuyanzin
reviewed
May 19, 2026
|
|
||
| AlterMaterializedTableChangeOperation op = | ||
| (AlterMaterializedTableChangeOperation) operation; | ||
| assertThat(op.getTableIdentifier().toString()).isEqualTo("`builtin`.`default`.`base_mtbl`"); |
Contributor
There was a problem hiding this comment.
Suggested change
| assertThat(op.getTableIdentifier().toString()).isEqualTo("`builtin`.`default`.`base_mtbl`"); | |
| assertThat(op.getTableIdentifier()).hasToString("`builtin`.`default`.`base_mtbl`"); |
Contributor
Author
There was a problem hiding this comment.
Addressed and updated it in the other tests too
snuyanzin
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
The parser already accepted
ALTER MATERIALIZED TABLE t SET ('k' = 'v'), but the planner had no converter registered forSqlAlterMaterializedTableOptions. As a result, the statement was rejected at plan time withTableException: Unsupported query.Add
SqlAlterMaterializedTableOptionsConverterand register it inSqlNodeConverters#registerMaterializedTableConverters. The converter emits anAlterMaterializedTableChangeOperationwith oneTableChange.set(key, value)per option provided. Merge with existing options is handled byMaterializedTableChangeHandler.setTableOption, which mirrors the create-or-alter path established in FLINK-39199.Planner-level tests cover the success path, single-option summary string, unknown table, and applying SET to a regular table. A gateway IT test exercises the end-to-end flow in FULL refresh mode where the change is applied directly to the catalog. The user-facing docs are updated for the new SET clause.
Brief change log
SqlAlterMaterializedTableOptionsConverterSqlNodeConverters#registerMaterializedTableConvertersVerifying this change
SqlMaterializedTableNodeToOperationConverterTest.javaMaterializedTableStatementITCase.javaDoes this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation
Was generative AI tooling used to co-author this PR?
Generated-by: Opus 4.7