apache/seatunnel

[Feature][CDC][DDL] Support comment-related schema change events for CDC schema evolution

Open

#10776 opened on Apr 16, 2026

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Java (6,897 stars) (1,432 forks)batch import
apicdcddldiscussionfeaturehelp wanted

Description

Search before asking

I searched existing issues with keywords such as table comment, column comment, SchemaChangeEvent, and CDC comment.

There is a related issue about target tables missing comments during MySQL auto-creation:

  • #10736

This issue is related, but the scope here is different: it focuses on CDC schema evolution events for comment-related DDL, especially comment-only changes and table comments.

What would you like to be added?

SeaTunnel CDC schema evolution currently focuses on column-level structural changes:

  • add column
  • drop column
  • modify column
  • rename/change column

The API schema change types currently include column-oriented events such as ADD_COLUMN, DROP_COLUMN, UPDATE_COLUMN, and RENAME_COLUMN. There is no dedicated schema change event for table comments, column comment-only changes, or other comment metadata changes.

At the same time, SeaTunnel already has some partial comment support:

  1. CatalogTable has a table comment field.
  2. Column has a column comment field.
  3. The MySQL CDC parser can parse column comments from column definitions.
  4. Existing tests verify that a column comment can be preserved in a column change event.

However, comment-related DDL is not represented as a first-class schema evolution event.

Why is this needed?

Many CDC pipelines expect sink schemas to preserve source table metadata, especially in data warehouse and lakehouse scenarios.

Examples:

ALTER TABLE user COMMENT = 'user profile table';
ALTER TABLE user MODIFY COLUMN name VARCHAR(128) COMMENT 'user display name';

For a comment-only table DDL, the current schema change model may parse no column events and therefore produce no SchemaChangeEvent. This makes it hard for sinks to keep table comments synchronized.

For column comments, the comment may be carried only when the DDL is represented as a column add/modify/change event. It is not clear whether comment-only updates should be expressed as a dedicated event or normalized into an existing update-column event.

Proposal for discussion

This should probably start as a design discussion before implementation.

Possible directions:

  1. Add dedicated schema change events, for example:
    • AlterTableCommentEvent
    • AlterColumnCommentEvent
  2. Or extend existing column/table schema events to explicitly model comment-only changes.
  3. Update CDC schema resolvers to parse comment-related DDL from supported dialects.
  4. Update sink schema evolution handlers to apply comments where the sink supports them.
  5. Document the connector support matrix because not every sink supports table/column comments.

Suggested implementation scope

Contributors are welcome to help implement this incrementally.

A first PR could focus on MySQL CDC only:

  1. Add API event representation for table comment and/or column comment changes.
  2. Parse MySQL ALTER TABLE ... COMMENT = ....
  3. Parse or normalize MySQL column comment-only DDL.
  4. Add unit tests for the CDC schema resolver.
  5. Add one sink implementation or a no-op fallback with clear documentation.

Follow-up PRs can add support for more dialects and sinks.

Compatibility

This can be introduced as an additive schema evolution capability. Existing schema change behavior does not need to change unless a connector or sink opts into applying comment-related events.

Contributor guide