Skip to content

Conversation

@snuyanzin
Copy link
Contributor

@snuyanzin snuyanzin commented Dec 8, 2025

What is the purpose of the change

The next part of FLIP-550 which adds support for ALTER MATERIALIZED TABLE MODIFY in way like

ALTER MATERIALIZED TABLE myMaterializedTable MODIFY c1 AS current_timestamp COMMENT 'new_column docs';

and

ALTER MATERIALIZED TABLE myMaterializedTable MODIFY (
     ts AS current_timestamp FIRST,
     col_meta INT METADATA FROM 'mk1' VIRTUAL AFTER col_b,
     PRIMARY KEY (id) NOT ENFORCED,
     WATERMARK FOR ts AS ts - INTERVAL '3' SECOND
);

Brief change log

parser and converters

Verifying this change

parser and converter's test added

Does this pull request potentially affect one of the following parts:

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

Documentation

  • Does this pull request introduce a new feature? (no, there will be a separate PR for docs)
  • If yes, how is the feature documented? (not applicable)

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 8, 2025

CI report:

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

|
AlterTableAddOrModify(ctx)
|
<LPAREN>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I am curious why do we have a mix of LPAREN and ( . I assume we should use LPAREN for all left brackets so it uses the grammar constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<LPAREN> means there will be a token parsed if it faces ( in sql
( is just a part of syntax which has nothing to do with <LPAREN>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it just says that if it meets something matching
inside (...)* then it should expect it arbitrary amount of times

@github-actions github-actions bot added the community-reviewed PR has been reviewed by the community. label Dec 8, 2025
Copy link
Contributor

@twalthr twalthr left a comment

Choose a reason for hiding this comment

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

Thank you @snuyanzin. I just had minor comments. LGTM overall.

LogicalType dataType =
createDataType(context.getCatalogManager().getDataTypeFactory(), col);
LogicalType oldDataType = map.get(col.getName()).getDataType().getLogicalType();
if (!LogicalTypeCasts.supportsImplicitCast(oldDataType, dataType)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this new logic or was this previous behavior?

Copy link
Contributor Author

@snuyanzin snuyanzin Dec 15, 2025

Choose a reason for hiding this comment

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

added a comment referencing code for CREATE [MATERIALIZED ]TABLE path with similar logic

Copy link
Contributor

@twalthr twalthr left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @snuyanzin

@snuyanzin
Copy link
Contributor Author

@flinkbot run azure

@snuyanzin snuyanzin merged commit 457b3de into apache:master Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants