det101 opened a new pull request, #12014:
URL: https://github.com/apache/seatunnel/pull/12014

   ## Purpose
   
   MySQL-CDC currently drops `TRUNCATE TABLE` because Debezium 1.9.8 emits it 
as a schema-history record without `TABLE_CHANGES`, and 
`AbstractSchemaChangeResolver` only accepts `ALTER TABLE`. This change captures 
table-level `TRUNCATE` as an independent **table-operation** event and applies 
it on Zeta + JDBC sink.
   
   Fixes #8259
   
   ## Changes
   
   - Add `table-operations.enabled` / `include` / `exclude` (default off; valid 
name today: `truncate.table`). Do **not** hang this off 
`schema-changes.include`.
   - When table-operations is on, open Debezium `include.schema.changes` so the 
TRUNCATE DDL is visible, but still send structural `ALTER TABLE` downstream 
only if `schema-changes.enabled` is true.
   - Parse table names from DDL (Antlr), match captured tables, reuse 
schema-change before/after watermarks (flush → truncate → checkpoint).
   - JDBC sink flushes buffered rows then executes `TRUNCATE TABLE`; sinks that 
do not implement `SupportTableOperationSinkWriter` fail fast. Flink / Spark 
collectors fail fast (Zeta only).
   - Docs (`docs/en` + `docs/zh`) and unit/E2E coverage for enabled and 
default-disabled paths.
   
   ## Non-goals
   
   - `DROP TABLE` and other table operations
   - Other CDC sources
   - Non-JDBC sinks
   - Upgrading Debezium
   - Folding `TRUNCATE` into `SchemaChangeEvent`
   
   ## Test plan
   
   - [x] Unit: DDL classify, table-operation filter, MySQL resolver/parser, 
JDBC flush-then-truncate, deserialize fail-fast / ALTER gating
   - [x] `spotless:check` on changed CDC modules
   - [ ] E2E `MysqlCDCWithTruncateIT` (Zeta + Testcontainers; Flink/Spark 
disabled)
   - [ ] CI on this PR
   
   ## Related
   
   - Issue: #8259
   
   
   Made with [Cursor](https://cursor.com)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to