You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "wgzhao (via GitHub)" <gi...@apache.org> on 2026/09/17 00:58:58 UTC
[PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
wgzhao opened a new pull request, #12355:
URL: https://github.com/apache/seatunnel/pull/12355
### Purpose of this pull request
Fixes #12354.
**Symptom.** A MySQL `SET` or `ENUM` column that reaches a MySQL-CDC source through the schema-change path gets a source type of `SET(5)` / `ENUM(1)` instead of `SET('a','b','c')` / `ENUM('x','y')`. With `schema_save_mode = CREATE_SCHEMA_WHEN_NOT_EXIST` on a MySQL sink, the generated `CREATE TABLE` contains `` `col` SET(5) NULL ``, and MySQL rejects it with a syntax error.
**Mechanism, layer by layer.**
1. Debezium reports the bare type name for these two types and keeps the option list on the column. From `io.debezium.connector.mysql.antlr.listener.ColumnDefinitionParserListener` (SeaTunnel ships its own copy with the same logic):
```java
if (dataType.name().equalsIgnoreCase("SET")) {
int optionsSize = ...;
columnEditor.length(Math.max(0, optionsSize * 2 - 1)); // options + commas, not a DDL length
}
...
if (dataTypeName.equals("ENUM") || dataTypeName.equals("SET")) {
columnEditor.type(dataTypeName);
columnEditor.enumValues(collectionOptions); // raw SQL literals, quotes included
}
```
So `SET('a','b','c')` arrives as `typeName = "SET"`, `length = 5`, `enumValues = ["'a'","'b'","'c'"]`.
2. `SeatunnelDDLParser.toSeatunnelColumnWithFullTypeInfo` then rebuilds the source type as `typeName + "(" + length + ")"`. That is correct for `VARCHAR(255)` or `DECIMAL(10, 2)`, but for these two it renders the bookkeeping count: `SET(5)`, `ENUM(1)`.
3. `MysqlCreateTableSqlBuilder.buildColumnIdentifySql` writes `Column#getSourceType()` verbatim for MySQL targets, so the value reaches the generated DDL.
**Fix.** Override `getSourceColumnTypeWithLengthScale` in the MySQL ALTER listener to render the option list when the column carries one, and fall back to the base implementation otherwise.
**Why the fix is not in `MySqlTypeUtils`.** That is where I first tried, and it does not work: `toSeatunnelColumnWithFullTypeInfo` overwrites whatever `toSeatunnelColumn` produces, so a change there is dead code on this path. `MySqlTypeUtils` produces the parameterless type by design, and the component that adds the parameters is the one that has to know that `SET` / `ENUM` take options rather than a length. I am calling this out because `MySqlTypeUtils` is the obvious place to look, and the regression test below is what caught my first attempt.
**Scope.** The snapshot path is not affected: table structures discovered at job start come from the JDBC catalog and carry the full `information_schema.COLUMN_TYPE` (`set('a','b','c')`). Only columns arriving through `ALTER TABLE` / `MODIFY COLUMN` while the job is running go through the reconstruction above. The override lives in the MySQL listener rather than in the shared `SeatunnelDDLParser` default in `connector-cdc-base`, so no other dialect is affected.
### Does this PR introduce _any_ user-facing change?
Yes - a bug fix, and only on the schema-change path:
- **Before**: a `SET` / `ENUM` column added or modified while the job is running reached a MySQL sink as `SET(5)` / `ENUM(1)`, which the sink cannot create.
- **After**: it reaches the sink as `SET('a','b','c')` / `ENUM('x','y')`.
No config option, default value, public API, SPI contract, serialization format or checkpoint state is touched. Every other type keeps the previous rendering, because the base implementation is still used whenever the column carries no option list.
### How was this patch tested?
The regression test drives the real Debezium DDL parser rather than a hand-built column, so it exercises the production path end to end:
```java
parser.parse("ALTER TABLE products ADD COLUMN c_set SET('a','b','c') NULL, "
+ "ADD COLUMN c_enum ENUM('x','y') NULL", new Tables());
```
and asserts that the resulting `AlterTableAddColumnEvent.getColumn().getSourceType()` is `SET('a','b','c')` / `ENUM('x','y')` while the data type stays `STRING`.
I confirmed it is a real regression test by reverting only the override and re-running it:
```
expected: <SET('a','b','c')> but was: <SET(5)>
```
DDL validity, checked against a throwaway MySQL 9.7.2 (the grammar is the same on 8.x):
```
CREATE TABLE t (c SET(5)); -> ERROR 1064 (42000): ... right syntax to use near '5))'
CREATE TABLE t (c SET); -> ERROR 1064 (42000): ... right syntax to use near ')'
CREATE TABLE t (c SET('a','b','c')); -> Query OK
```
Full unit test suite of the connector:
```
$ mvn -pl seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql test
Tests run: 37, Failures: 0, Errors: 0, Skipped: 0
```
`spotless:apply` is clean and does not reformat the change.
No E2E case is added. Reproducing this needs an `ALTER TABLE` scheduled in the middle of a running CDC job, while the test above already drives the exact production path (Debezium DDL parser -> ALTER listener -> source type); I am happy to add one if reviewers would prefer it.
### Check list
* [x] If any new Jar binary package adding in your PR, please add License Notice according
[New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
* [x] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
* [x] If necessary, please update `incompatible-changes.md` to describe the incompatibility caused by this PR.
* [x] If you are contributing the connector code, please check that the following files are updated:
1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
---
Related: #10451 (the reported failure), #10453 and #12333 (the `SET UNSIGNED` work on the same code path; this issue was raised during the review of #10453 and is independent of both).
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo merged PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5851858576
Thanks for the ping, @wgzhao - yes, I'll take this one over so it isn't stuck waiting.
To be plain about where things stand: I have not yet done my own pass on `4f6663a9f`, so nothing is approved or merged from my side yet. What I'll do is re-check the head against the points from the earlier review, and I'd appreciate a few pointers to make that quick:
1. **ENUM/SET `columnLength` (the main finding):** you mention the length derivation in `MySqlTypeUtils` - can you confirm that this derived length is what actually ends up in `Column.columnLength` (not just in `getSourceType()`), so heterogeneous sinks no longer see 1-char / 2n-1-char strings?
2. **`getColumnLength()` assertions and edge shapes:** you mention six `getColumnLength()` assertions and the unquoted/escaped-quote handling. Could you point me to the specific test cases covering the embedded-comma option, the escaped quote, the single-option `SET`, and an option list followed by a `CHARACTER SET` clause? The last one in particular I don't see called out in-thread, so if it isn't pinned yet, please add it (or tell me why it isn't needed).
3. **The two Javadocs:** you say both now use the fully-qualified `org.apache.seatunnel.api.table.catalog.Column#getSourceType()` and describe the pre-fix value as `SET(5)`/`ENUM(1)` - I'll verify that directly; no action needed unless my read differs.
If those check out on `4f6663a9f`, I'll approve and merge, and then we can move on to #12373 / #12333 / #10453. If anything doesn't line up I'll leave inline comments rather than asking for another round here.
<!-- streview-comment:1335 -->
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5713619101
Filed the follow-up as #12371 and drafted the coverage as #12372 - it is a draft on purpose: without this PR the sink receives `SET(5)` and MySQL rejects the generated `ALTER TABLE`, so the new case is expected to be red on `dev` until this one merges. Once #12355 lands, I will rebase #12372 and mark it ready.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5713342107
Thanks — Issue 1 is addressed in `5507c2c7d`, on top of the `dev` sync you suggested (`a3115f14`).
**Issue 1 — MODIFY / CHANGE COLUMN coverage.** Added `testParseAlterTableModifyAndChangeSetAndEnumColumnKeepOptionList` to the existing test class rather than a new one. It drives a single statement with three alter options — `MODIFY COLUMN c_set SET('a','b','c') NULL`, `CHANGE COLUMN c_enum_src c_enum ENUM('x','y') NULL` and `MODIFY COLUMN c_varchar VARCHAR(64) NULL` — and asserts the rebuilt types `SET('a','b','c')`, `ENUM('x','y')` and `VARCHAR(64)`, the `STRING` data type on both SET/ENUM columns, and the old/new names on the CHANGE event.
Two details worth calling out:
- `CHANGE COLUMN` goes through `rename()` before the event is emitted, so we read `PhysicalColumn.rename` and confirmed it carries `sourceType` across; the assertion now pins that behaviour.
- The `VARCHAR` option in the same statement is deliberate: it keeps the fallback to `SeatunnelDDLParser.super` under test, so a future change that routes every type through the option-list branch fails here.
We also ran these shapes as a scratch test before writing this one (MODIFY SET, MODIFY ENUM, CHANGE with rename, plus a VARCHAR control) to confirm this is coverage rather than a latent defect — all four produced the expected types, so your reading that the shared call path makes it a completeness gap was right.
**Issue 2 — E2E.** We would rather not fold it in here. The only natural host is `MysqlCDCWithSchemaChangeIT`, a Testcontainers + zeta schema-evolution suite with ordered cases that already runs under a 300s convergence timeout; proving "MySQL accepts the generated `SET(...)`" needs a new source/sink fixture, a job config, an ALTER adding a SET column and a post-DDL assertion — a piece of e2e work in its own right rather than an extra assertion. If you agree that a follow-up issue is the right home, we will file it and link it here; if you would rather see it in this PR, say so and we will add it.
CI is re-running on `5507c2c7d`.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5825723708
@SEZ9 - gentle bump, no new commits have landed: the head is still `4f6663a9f`, its `Build` is green (the Windows `PayPalClientTest` job passed on re-run), and the answers to your four points are in the reply above (the length rule and its unquoted/escaped-quote handling, the per-item mapping, the six `getColumnLength()` assertions, and the two Javadoc references).
If there is anything else you would like changed, tell me and I will do it. Otherwise the last step is an approving review from your account, since contributor approvals do not satisfy the `dev` ruleset - and, as the author has no write access to the repository, could you also merge it (or add it to the merge queue) once you are happy? It is the sequencing blocker for #12373, and #12333 / #10453 are code-complete behind it.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5787984776
Thanks for the detailed pass - all five are addressed in `4f6663a9f`.
**Issue 1 (Medium)** - fixed in `MySqlTypeUtils.convertToSeaTunnelColumn`, the place you suggested: `SET` / `ENUM` now derive their length from `Column#enumValues()` the way the existing `TINYINT` case re-derives the type it needs. Members are unquoted (and `''` collapsed) before measuring; the length is the longest member for `ENUM` and the members plus their separators for `SET`. The regression test now asserts `getColumnLength()` alongside the type, so the bookkeeping value cannot come back unnoticed: `ENUM('x','y')` -> 1, `ENUM('active','inactive')` -> 8, `SET('a','b','c')` -> 5, `SET('only')` -> 4, `SET('a,b','it''s')` -> 8.
I put it there rather than in the listener on purpose: the same bookkeeping value reaches sinks that reconvert from either entry point, so deriving it once at the conversion keeps the schema-change path and any other caller consistent instead of fixing only the path that has an event.
**Issue 2** - the test Javadoc now matches the production one: the field emitted verbatim into auto-create DDL is `Column#getSourceType()`, and the base `getSourceColumnTypeWithLengthScale` renders the bookkeeping length as `SET(5)` / `ENUM(1)`.
**Issue 3** - added exactly the case you called out: `ENUM('active','inactive')` with a `getColumnLength()` assertion, plus a single-option `SET('only')` whose bookkeeping length is 1, so a wrong fallback cannot pass for the right reason.
**Issue 4** - the verbatim join is pinned for the boundary shapes: `SET('a,b','it''s')` has to round-trip as that exact text (embedded comma and doubled-quote escape), and the length assertion covers the unescaped members plus the separator. For `CHARACTER SET` I probed the parser and pinned the behaviour rather than guessing: `ENUM('x','y') CHARACTER SET utf8mb4` rebuilds to `ENUM('x','y')`, i.e. the charset clause is not part of the rebuilt expression and the sink applies its own default for the added column. That is pre-existing behaviour rather than something this PR changes, but it is now explicit in the test. If you would rather the clause survived into the generated DDL, say so - the parser does keep `charsetName` on the column, so it is a small addition, and I am happy to do it here or leave it in #12371.
**Issue 5** - the override's Javadoc now spells out `org.apache.seatunnel.api.table.catalog.Column#getSourceType()`, consistent with how the rest of that file disambiguates the two `Column` types.
Locally the module suite is 37/38 with the only failure being `MySqlSchemaTest` on this machine's JDK 23 (`Mockito`/Byte Buddy), which fails identically without these changes; CI runs it on 8/11. The new head is `4f6663a9f` and CI is re-running on it - I will not push again while it is under review.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5846468753
@nzw921rx (cc @davidzollo) - would one of you be able to take this one over? It is code-complete and its `Build` is green on the current head `4f6663a9f`; every point raised in review has been addressed and answered in-thread (the SET/ENUM length derivation in `MySqlTypeUtils`, the `getColumnLength()` assertions, and the two Javadoc references), and @DanielLeens has approved it on this head.
The only thing outstanding is an approving review from a write-access account - contributor approvals do not satisfy the `dev` ruleset - and since the author has no write access to the repository, a merge once you are satisfied. @SEZ9 started the review but has been away for a couple of days, so rather than keep waiting I wanted to ask directly.
Context for the sequencing: #12373 is end-to-end coverage that is red on purpose until this fix lands, and #12333 / #10453 are code-complete behind it - all three have been reviewed and are waiting on the same gate.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-6078322049
Thanks @davidzollo - with your approval and a green `Build` on `4f6663a9f` (42 jobs succeeded, none failed), both gates on this one are satisfied and the only step left is the merge itself, which we cannot do from here as the author has no write access. Could you press it (or add it to the merge queue)?
Once it lands I will rebase #12373 onto `dev` and confirm its `mysql-cdc-connector-it` lane turns green (it is red on purpose until this fix is in), then follow up on #12333 and #10453.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5851881540
Thanks for taking it over - here are the pointers, all on the unchanged head `4f6663a9f` (Build is green, so nothing has moved under you).
**1. Does the derived length actually reach `Column.columnLength`?** Yes. `MySqlTypeUtils.java:165-168` sets `builder.length(...)`/`precision(...)` from `maxOptionListLength` (`:189`, with the unquote/`''`-collapse helper at `:212`), and `MySqlTypeConverter`'s `MYSQL_ENUM`/`MYSQL_SET` case copies `typeDefine.getLength()` into `builder.columnLength(...)` (`MySqlTypeConverter.java:247-253`). That is why the fix lives in the conversion rather than in the listener: `reSourceType` only replaces the string and never touches `columnLength`, so a listener-only fix would still leave heterogeneous sinks reading the bookkeeping value through `reconvert`. The test assertions are on `getColumnLength()` of the column the parser returns, i.e. the same field the sink path reads - not just `getSourceType()`.
**2. Test cases.** All in `CustomMySqlAntlrDdlParserTest#testParseAlterTableAddSetAndEnumColumnKeepsOptionList`; the DDL that creates each shape is at `:120-126` and the assertions are:
- multi-character members - `ENUM('active','inactive')`: `:150` (sourceType) and `:152` (`getColumnLength()` == 8)
- single-option `SET('only')`: `:158` and `:159` (== 4)
- embedded comma plus escaped quote - `SET('a,b','it''s')`: `:165` (exact round-trip of the text) and `:167` (== 8)
- `CHARACTER SET` clause - DDL at `:126`, assertions at `:174-175`, with the rationale comment at `:169-171`
- the two baseline shapes: `SET('a','b','c')` `:137` (== 5), `ENUM('x','y')` `:143` (== 1)
On the charset case specifically: it is pinned, and the behaviour it pins is that the rebuilt expression carries the option list only - `ENUM('x','y') CHARACTER SET utf8mb4` comes back as `ENUM('x','y')`, so the sink applies its own default charset for the added column. That is pre-existing behaviour, not something this PR changes, and I called it out in the earlier reply (https://github.com/apache/seatunnel/pull/12355#issuecomment-5806847189). If you would rather the clause survived into the generated DDL, the parser does keep `charsetName` on the column so it is a small addition - say the word and I will push it, otherwise it stays as documented.
For convenience, the four-point answer is https://github.com/apache/seatunnel/pull/12355#issuecomment-5806847189 and the original per-item mapping is https://github.com/apache/seatunnel/pull/12355#issuecomment-5787984776 (that one is a conversation-level comment, which is why it did not show up in the review thread).
**3. Javadocs** - both are as described; if your read differs, inline comments are welcome and I will turn them around quickly.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5806330422
Thanks @wgzhao - and apologies for the delay, this fell off my radar. Happy to take another look at `4f6663a9f` now.
Before I do, a few quick things so I can close each of the five points cleanly:
1. **Length leaking into `columnLength` (the first point)** - you mention the `SET`/`ENUM` length is now derived from the option list in `MySqlTypeUtils`. Can you confirm the rule you landed on (e.g. `ENUM` = length of the longest option, `SET` = sum of option lengths plus `n-1` separators), and whether it works off the raw quoted option text or the unquoted values? Escaped quotes / multi-byte options would give different answers depending on which one is used, so I want to check that against the test expectations.
2. **Per-item breakdown** - you reference a reply "just above" with the item-by-item breakdown, but I don't see it in the thread on my side. Could you re-post or link it? It would save me guessing which hunk maps to which point.
3. **Test coverage (points 3 and 4)** - the new shapes you list (multi-character, embedded comma, escaped quote, `CHARACTER SET`) cover the verbatim-join cases. Do the tests also assert `columnLength` (not only `getSourceType()`) for those shapes, and is the single-option `SET` case included? Those were the two remaining gaps I had flagged.
4. **Javadocs (points 2 and 5)** - just confirm the test Javadoc now describes the pre-fix value as `SET(5)` and refers to `Column#getSourceType()` on the SeaTunnel `Column`, and that the override's Javadoc uses a qualified reference so it doesn't resolve to the Debezium `Column`.
If those all check out I don't expect anything further on the code side, and I'll leave a review on the head accordingly. No need to touch the branch in the meantime.
<!-- streview-comment:1268 -->
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5713399301
Filed the follow-up as #12371 — it tracks the end-to-end case (an ALTER-added `SET` / `ENUM` column flowing through the sink auto-create DDL against a real MySQL server), including the open point that `mysqlcdc_to_mysql_with_schema_change.conf` does not set `schema_save_mode` explicitly, so it needs confirming which mode the fixture actually exercises.
If you would rather have that case in this PR instead of a follow-up, say so and we will pull it in here.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5852877268
Thanks for looping me back in, @SEZ9 and @wgzhao — I've been following the last few days of back-and-forth.
To save you some digging: nothing has changed here since my last two posts on this exact head (`4f6663a9f`):
- My full re-review and approval: https://github.com/apache/seatunnel/pull/12355#pullrequestreview-5289848923 (2026-09-23), where I independently re-derived the `columnLength` fix in `MySqlTypeUtils` by hand.
- My follow-up cross-check: https://github.com/apache/seatunnel/pull/12355#issuecomment-5812770981 (2026-09-24), where I re-verified the same five length values (`SET('a','b','c')` -> 5, `ENUM('x','y')` -> 1, `ENUM('active','inactive')` -> 8, `SET('only')` -> 4, `SET('a,b','it''s')` -> 8) against `MySqlTypeUtils.maxOptionListLength`/`unquotedValueLength`, and confirmed the `getColumnLength()` assertions and the two fully-qualified Javadoc references were present on this same head.
@SEZ9, your three pointers today line up with @wgzhao's two earlier per-item answers — https://github.com/apache/seatunnel/pull/12355#issuecomment-5787984776 and https://github.com/apache/seatunnel/pull/12355#issuecomment-5806847189 — which is also what I checked against independently above, so there shouldn't be anything left to reconcile: the derived length does land in `Column.columnLength` via `MySqlTypeUtils.java:165-168` -> `MySqlTypeConverter.java:247-253` (not just in `getSourceType()`), and the boundary shapes (multi-character options, the single-option `SET`, the embedded-comma/escaped-quote option, and the `CHARACTER SET` clause) each carry both a `getSourceType()` and a `getColumnLength()` assertion in `CustomMySqlAntlrDdlParserTest`.
For the record: no new commit has landed since my approval, `Build` is currently green on `4f6663a9f` (I just re-checked the status rollup myself), and from my side there are no remaining code-side blockers. The only outstanding item is procedural, not technical: per the `dev` branch ruleset a contributor approval — mine included — doesn't satisfy branch protection, so this genuinely needs an approving review (and merge) from an account with write access. @SEZ9, whenever your own pass on the diff lines up with the above, that's the piece that unblocks this.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5806847189
No problem at all - head is unchanged at `4f6663a9f`, so there is nothing to re-sync. Answers to the four points:
**1. The length rule.** `MySqlTypeUtils.java:156-168` (helpers at `:189` and `:212`). The option values are unquoted first, then: `ENUM` = the longest single option, `SET` = the sum of the option lengths plus `n-1` separators, i.e. the length of the value as stored. Concretely `SET('a','b','c')` -> 1+1+1+2 = 5, `SET('only')` -> 4, `ENUM('active','inactive')` -> 8. It measures the unquoted values, not the raw text: `unquotedValueLength` strips the surrounding `'` and collapses `''` to `'` before measuring, so `SET('a,b','it''s')` -> 3 + 4 + 1 = 8.
On multi-byte options, one honest caveat: the measurement is in characters (`String.length()`), which is the right basis for the reconverted `VARCHAR(n)` the non-MySQL sinks build, and we deliberately do not apply the `charTo4ByteLength` conversion VARCHAR uses because that one is about byte capacity, not the stored string length. `String.length()` counts UTF-16 units, so an option containing an astral-plane character would count 2 instead of 1 - that only oversizes the target column, it cannot truncate. If you want it exact, `codePointCount` plus one assertion is a one-line change; I left it out because CI has already validated this head, but I will push it if you prefer.
**2. The per-item breakdown** - it is at the conversation level rather than in the review thread, which is probably why it did not show up for you: https://github.com/apache/seatunnel/pull/12355#issuecomment-5787984776 (posted 2026-09-23 02:36Z, about ten minutes after your review). Compact mapping: Issue 1 -> `MySqlTypeUtils` length derivation; Issue 2 -> the test Javadoc; Issues 3 and 4 -> the added columns and assertions in that same test; Issue 5 -> the override's Javadoc.
**3. `columnLength` assertions.** Yes, on the same columns and not only `getSourceType()`, all through the real pipeline (ANTLR parse -> listener -> `MySqlTypeUtils` -> `MySqlTypeConverter`), so they pin the length on the SeaTunnel column: `CustomMySqlAntlrDdlParserTest:137` `SET('a','b','c')` -> 5, `:143` `ENUM('x','y')` -> 1, `:152` `ENUM('active','inactive')` -> 8, `:159` `SET('only')` -> 4 (the single-option case), `:167` `SET('a,b','it''s')` -> 8 (embedded comma plus escaped quote), `:175` the `CHARACTER SET utf8mb4` case -> 1.
**4. Javadocs.** The test Javadoc now says the base `getSourceColumnTypeWithLengthScale` renders the bookkeeping length as `SET(5)` / `ENUM(1)` and that the field emitted verbatim into auto-create DDL is `org.apache.seatunnel.api.table.catalog.Column#getSourceType()`; the override's Javadoc in `CustomAlterTableParserListener` uses that same fully qualified reference, so it cannot resolve to the Debezium `Column`.
Locally the module suite is 37/38, with the only failure being `MySqlSchemaTest` on this machine's JDK 23 (`Mockito`/Byte Buddy), which fails identically without these changes; on CI this head's `Build` is green after the Windows flake job was re-run. The branch stays frozen for your review.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5793734230
@SEZ9 - all five points from your review are addressed in `4f6663a9f` (the reply with the per-item breakdown is just above), so this is ready for another look whenever you have a moment: the `SET` / `ENUM` column length is now derived from the option list in `MySqlTypeUtils`, the two Javadocs are aligned, and the regression test pins the multi-character, embedded-comma, escaped-quote and `CHARACTER SET` shapes.
Nothing else is pending on the code side - `DanielLeens` re-approved the new head, and the only red job on it is `unit-test (11, windows-latest)` (`PayPalClientTest` timing), which is unrelated. Once you are happy with the head, an approving review from a write-access account is the last thing this needs to move; I will keep the branch frozen until then.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5775821033
@SEZ9 - you reviewed the sibling PR #10453 and confirmed it was ready to merge; this one is the sequencing blocker for that PR and for #12333, and it is now the only thing standing between the four of them and `dev`.
State as of today: `DanielLeens` re-confirmed on the current head `e6e9b6b3` that there are no code-side blockers, and traced the remaining red jobs himself (`PayPalClientTest` Windows timing, `DorisSchemaChangeIT`) as unrelated to this diff. Nothing is pending in code, tests or docs. The only missing piece is an approving review from an account with write access, since contributor approvals do not satisfy the `dev` ruleset.
If you (or any other committer) can spare the short look, the whole chain unblocks: once this lands I rebase #12373 (its e2e is red on purpose until this fix is in) and then #12333 and #10453 follow. If you would rather it went a different way, tell me and I will adjust.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5775122849
Thanks for pulling the actual job log instead of just the aggregate status - that confirms my suspicion. My review stands: no code-side blockers, approval recorded on the current head, and this CI failure does not implicate connector-cdc-mysql or anything this PR touches.
For anyone following along later: I re-checked the fork's `Build` run on this same head just now, and the failing set has since rotated (`unit-test (8, windows-latest)` and `doris-connector-it (8, ubuntu-latest)`), not the openGauss job you diagnosed a few days ago. I pulled both logs - the Windows failure is `PayPalClientTest.closeWakesRetryWait`, the same pre-existing timing flake in `connector-http-paypal` noted in earlier rounds, and the Doris failure is `DorisSchemaChangeIT`, an unrelated Doris sink E2E error. Neither touches this PR's files or `connector-cdc-mysql` in any way, so the picture is unchanged even though the specific red job moved around - this looks like normal CI noise rotating across unrelated suites rather than anything tied to this fix.
So from my side there is nothing left to do here: the fix and its tests are sound, and this is purely waiting on a committer with write access to re-approve `e6e9b6b3193ec9c25397849c24b11a177394a5cf` so branch protection is satisfied. I'll keep watching and will flag promptly if anything changes.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5728613250
Thanks for the detailed status update, and sorry for the extra merge-gate friction here.
I checked this myself: my approval was recorded on `5507c2c7d`, and the only commit since then is the `dev` sync at `adb4c2654`. I diffed `5507c2c7d...adb4c2654` directly and the sync brings in exactly one file outside this PR's scope (`PayPalClientTest.java`, an unrelated Windows-timing fix on `connector-http-paypal`) — nothing in `connector-cdc-mysql` or any file this PR actually touches changed. So this is exactly what you described: `dismiss_stale_reviews_on_push` cleared the approval on a no-op sync, not because anything in the fix or its tests needs another look from me. My conclusion from the previous round stands unchanged on the current head: no blockers, ready to merge, with the E2E follow-up in #12371/#12373 correctly scoped as non-blocking.
Since branch protection on `dev` requires the approval to land from a write-access account, I can't re-satisfy that gate myself — this does need a committer (@davidzollo / @nzw921rx or anyone else with write access) to take the short look and approve on `adb4c2654` so it can move forward. I'll keep an eye out and re-review promptly if anything else changes before then.
On the current `Build` check: I see one failing job on this head. I haven't dug into it for this round since there's no new production/test code to re-review, but flag it in case it turns out unrelated-infra like the previous rounds — worth a quick look before merge either way.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-6072128113
Gentle bump so this one doesn't stall — from the source side it's done: `Build` is green on the current head `4f6663a9f`, @DanielLeens re-derived the `columnLength` fix by hand, and @SEZ9 has taken it over for the final pass.
The only thing between it and merge is the `dev` ruleset: it needs an approving review from an account with **write access**, and contributor reviews aren't counted toward that, so the approvals recorded so far don't clear the gate. @SEZ9 whenever your pass on the diff lines up, a committer approval here unblocks it. cc @davidzollo @nzw921rx for coverage.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5726183681
cc @davidzollo @nzw921rx - this one is code-complete and was approved by @DanielLeens on source review; it is now waiting only on the merge gates, so a committer look would unblock a chain of work.
Where it stands:
- Head is `adb4c2654` after syncing `dev`. The approval was recorded on the previous head and `dismiss_stale_reviews_on_push` cleared it, so it needs an approving review on the current commit - and, per the `dev` ruleset, one from someone with write access.
- Nothing is outstanding in code: `CustomMySqlAntlrDdlParserTest` covers `ADD`, `MODIFY` and `CHANGE` parsing of the option list, and the reviewer's one follow-up item was end-to-end coverage, which is tracked in #12371 and drafted as #12373.
- The red jobs on the latest `Build` are unrelated connectors (openGauss/Postgres CDC E2E timeouts, hudi/paimon, Windows timing), not `connector-cdc-mysql`.
The sequencing matters here: #12373 drives the sink DDL end to end and is deliberately red until this fix lands - the reviewer asked for it to be merged first, then rebased and confirmed green. So merging this one also clears the way for #12333 and #10453, which are in the same area and likewise code-complete.
If there is anything you would like changed before it goes in, or a reviewer you would rather have take it, say so and I will follow up.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5728909028
Quick answer to the `Build` question you flagged, since it is a two-minute check rather than a re-review:
The failing job on `adb4c2654` is `updated-modules-integration-test-part-3` (both JDK legs), and the failure inside it is `OpengaussCDCIT` - 1 error out of 23 tests, ~918s in, the same openGauss/Postgres CDC E2E timeout that has been recurring on unrelated PRs for days. I pulled the job log to confirm rather than reading the aggregate status: `connector-cdc-mysql` does not even appear in that partition (`MysqlCDCWithSchemaChangeIT` has zero occurrences in the log), so nothing in this PR's area ran red. The other 40 jobs in the run are green.
So the run is red only for environment reasons on this head, same picture as the previous rounds. Thanks for confirming the approval lapse was the no-op `dev` sync - that matches what I see: the only commit between `5507c2c7d` and `adb4c2654` is the `PayPalClientTest` fix that came in with `dev`.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5842227866
@wgzhao thanks for the bump, and apologies for the delay - this one is on me.
I have not yet verified the head `4f6663a9f` myself against my earlier points (the `columnLength` fix for `SET`/`ENUM`, the Javadoc references, and the `getColumnLength()` assertions with the boundary shapes). I will go through the diff now rather than rely on the summary in the thread. If everything lines up, I will submit an approving review and handle the merge; if anything does not match, I will leave a precise inline note.
No further changes are needed from you at this point.
<!-- streview-comment:1315 -->
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5812770981
Just following the thread here since I was tagged upstream in this conversation — no new commit landed since my last review, so this isn't a re-review, just a quick cross-check on the exchange above.
@SEZ9's four questions and @wgzhao's answers line up exactly with what I independently re-derived in my own approval on `4f6663a9f`: I hand-verified the same five length values against `MySqlTypeUtils.maxOptionListLength`/`unquotedValueLength` (`SET('a','b','c')` -> 5, `ENUM('x','y')` -> 1, `ENUM('active','inactive')` -> 8, `SET('only')` -> 4, `SET('a,b','it''s')` -> 8), and I can confirm the `getColumnLength()` assertions for all of those shapes are present in `CustomMySqlAntlrDdlParserTest#testParseAlterTableAddSetAndEnumColumnKeepsOptionList` on the current head, not just `getSourceType()` — so point 3 checks out as described. The two Javadocs (`CustomAlterTableParserListener#getSourceColumnTypeWithLengthScale` and the test) also already use the fully-qualified `org.apache.seatunnel.api.table.catalog.Column#getSourceType()` and describe `SET(5)`/`ENUM(1)` as the pre-fix value, matching point 4.
Nothing further from me — my approval stands unchanged on `4f6663a9f`. @SEZ9, happy to let you close out your own review once you've confirmed these against the head yourself.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "wgzhao (via GitHub)" <gi...@apache.org>.
wgzhao commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5713733141
Correction: that follow-up is now #12373 - the branch was renamed and the PR is no longer a draft (#12372 is closed as superseded). It is still expected to be red until this PR merges.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2][MySQL-CDC] Keep the SET/ENUM option list when rebuilding the source type [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12355:
URL: https://github.com/apache/seatunnel/pull/12355#issuecomment-5787066000
@/tmp/reply_body_12355.md
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org