Skip to content

[FLINK-40146][connect/starrocks] Support AlterTableCommentEvent in StarRocks sink#4477

Open
haruki-830 wants to merge 1 commit into
apache:masterfrom
haruki-830:FLINK-40146
Open

[FLINK-40146][connect/starrocks] Support AlterTableCommentEvent in StarRocks sink#4477
haruki-830 wants to merge 1 commit into
apache:masterfrom
haruki-830:FLINK-40146

Conversation

@haruki-830

Copy link
Copy Markdown
Contributor

Summary

This commit adds support for AlterTableCommentEvent to the Flink CDC pipeline StarRocks sink. When upstream table comments are changed, the StarRocks sink can now synchronize the table-level comment to StarRocks 3.1+ instead of treating the schema change as unsupported.

Key Changes

  1. Support Table Comment Changes
  • Added handling for AlterTableCommentEvent in StarRocksMetadataApplier.
  • Applies table-level comment changes by executing ALTER TABLE ... COMMENT = "..." for supported StarRocks versions.
  • Keeps the existing unsupported behavior for StarRocks versions lower than 3.1.
  1. StarRocks Version Compatibility Check
  • Added StarRocks version detection before applying table comment changes.
  • Uses current_version() to get the StarRocks server version.
  • Falls back to @@version_comment when current_version() is unavailable.
  • Does not use version() because StarRocks documents it as a MySQL-compatible server version.
  1. Table Comment Escaping
  • Added escaping for table comment string literals used in the generated ALTER TABLE ... COMMENT SQL.
  • Escapes backslashes, double quotes, newline characters, and carriage returns.
  1. Documentation and Test Coverage
  • Updated the StarRocks pipeline connector documentation in both English and Chinese.
  • Added unit test coverage for table comment support, version compatibility, and comment escaping.
  • Added integration test coverage for applying table comment changes.

JIRA Reference

https://issues.apache.org/jira/browse/FLINK-40146

Related Issue

https://issues.apache.org/jira/browse/FLINK-37203

@github-actions github-actions Bot added docs Improvements or additions to documentation starrocks-pipeline-connector labels Jul 17, 2026
@haruki-830

Copy link
Copy Markdown
Contributor Author

@lvyanquan PTAL when you have time, thanks!

@haruki-830
haruki-830 marked this pull request as ready for review July 17, 2026 03:47
@lvyanquan lvyanquan self-assigned this Jul 20, 2026
@leonardBang
leonardBang requested a review from lvyanquan July 20, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation starrocks-pipeline-connector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants