Mao Jiayi created FLINK-40146:
---------------------------------
Summary: Support AlterTableCommentEvent in StarRocks sink
Key: FLINK-40146
URL: https://issues.apache.org/jira/browse/FLINK-40146
Project: Flink
Issue Type: Improvement
Components: Flink CDC
Reporter: Mao Jiayi
Noticed that FLINK-37203 (https://issues.apache.org/jira/browse/FLINK-37203)
introduced AlterTableCommentEvent and AlterColumnCommentEvent to support
synchronizing table/column comment changes in Flink CDC. The corresponding PR
(https://github.com/apache/flink-cdc/pull/3893) implemented this capability for
several sinks, but the StarRocks sink was left unsupported with a TODO and
warning in StarRocksMetadataApplier.
When an upstream table comment is changed, the StarRocks pipeline sink
currently does not propagate the table comment change to the downstream
StarRocks table. This means the table comment in StarRocks may become
inconsistent with the upstream table after schema evolution.
StarRocks supports altering table comments since version 3.1 with syntax like
ALTER TABLE [db.]tbl COMMENT = "new table comment". Therefore, the StarRocks
pipeline sink should support AlterTableCommentEvent when the downstream
StarRocks version is 3.1 or later.
For StarRocks versions lower than 3.1, the sink should reject the unsupported
schema change clearly, for example by throwing
UnsupportedSchemaChangeEventException, instead of silently skipping it. This
allows TRY_EVOLVE mode to tolerate the unsupported change while EVOLVE mode
fails with a clear error.
The implementation should also properly escape the table comment string when
building the ALTER TABLE statement.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)