Search before asking
What happened
When using Dinky (based on Flink CDC) to sync a table containing a MySQL ENUM type column, the job fails to start and throws a ValidationException. It appears that Dinky (or the underlying Flink CDC / Fluss) fails to handle the length metadata correctly when parsing the MySQL ENUM type, resulting in an invalid length (e.g., 0) being passed to Flink's VarChar type.
What you expected to happen
ERROR org.dinky.cdc.AbstractSinkBuilder(153): Build cn_orders_cn.cc_prom_record cdc sync failed...
org.apache.flink.table.api.ValidationException: Variable character string length must be between 1 and 2147483647 (both inclusive).
at org.apache.flink.table.types.logical.VarCharType.(VarCharType.java:75)
at org.dinky.cdc.convert.DataTypeConverter.getLogicalType(DataTypeConverter.java:113)
How to reproduce
- Source Table Schema: Create a table in MySQL containing an ENUM type column.
CREATE TABLE cc_prom_record (
prom_id int unsigned NOT NULL AUTO_INCREMENT,
prom_order_status enum('Open','Close','Cancel','Pending') ..., -- Problematic column
PRIMARY KEY (prom_id)
);
- Dinky Job Configuration: Use the EXECUTE CDCSOURCE syntax to attempt a full + incremental sync of this table.
- Result: The job submission fails, and the logs show a type validation error.
Anything else
Dinky Version: 1.2.5
Root Cause Analysis
MySQL ENUM: In MySQL, ENUM is a special string object that allows choosing a value from a predefined set of values specified during table creation.
Flink Type Constraint: Flink's VarChar type strictly requires the length to be between 1 and 2147483647.
Mapping Defect: When parsing the ENUM type, Dinky (or the underlying Flink CDC / Fluss) incorrectly maps it to VarChar(0) or fails to calculate its maximum byte length properly, triggering Flink's validation exception.
Version
1.2.3
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
When using Dinky (based on Flink CDC) to sync a table containing a MySQL ENUM type column, the job fails to start and throws a ValidationException. It appears that Dinky (or the underlying Flink CDC / Fluss) fails to handle the length metadata correctly when parsing the MySQL ENUM type, resulting in an invalid length (e.g., 0) being passed to Flink's VarChar type.
What you expected to happen
ERROR org.dinky.cdc.AbstractSinkBuilder(153): Build cn_orders_cn.cc_prom_record cdc sync failed...
org.apache.flink.table.api.ValidationException: Variable character string length must be between 1 and 2147483647 (both inclusive).
at org.apache.flink.table.types.logical.VarCharType.(VarCharType.java:75)
at org.dinky.cdc.convert.DataTypeConverter.getLogicalType(DataTypeConverter.java:113)
How to reproduce
CREATE TABLE
cc_prom_record(prom_idint unsigned NOT NULL AUTO_INCREMENT,prom_order_statusenum('Open','Close','Cancel','Pending') ..., -- Problematic columnPRIMARY KEY (
prom_id));
Anything else
Dinky Version: 1.2.5
Root Cause Analysis
MySQL ENUM: In MySQL, ENUM is a special string object that allows choosing a value from a predefined set of values specified during table creation.
Flink Type Constraint: Flink's VarChar type strictly requires the length to be between 1 and 2147483647.
Mapping Defect: When parsing the ENUM type, Dinky (or the underlying Flink CDC / Fluss) incorrectly maps it to VarChar(0) or fails to calculate its maximum byte length properly, triggering Flink's validation exception.
Version
1.2.3
Are you willing to submit PR?
Code of Conduct