Copilot commented on code in PR #4284:
URL: https://github.com/apache/flink-cdc/pull/4284#discussion_r2889640810
##########
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-mysql/src/test/resources/ddl/inventory.sql:
##########
@@ -37,6 +37,26 @@ VALUES (default,"scooter","Small 2-wheel scooter",3.14),
(default,"jacket","water resistent black wind breaker",0.1),
(default,"spare tire","24 inch spare tire",22.2);
+-- Create a table where all fields are in uppercase.
+CREATE TABLE uppercase_products (
+ ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ NAME VARCHAR(255) NOT NULL DEFAULT 'flink',
+ DESCRIPTION VARCHAR(512),
+ WEIGHT FLOAT(6)
+);
+ALTER TABLE uppercase_products AUTO_INCREMENT = 101;
+
+INSERT INTO uppercase_products
+VALUES (default,"scooter","Small 2-wheel scooter",3.14),
+ (default,"car battery","12V car battery",8.1),
+ (default,"12-pack drill bits","12-pack of drill bits with sizes ranging
from #40 to #3",0.8),
+ (default,"hammer","12oz carpenter's hammer",0.75),
+ (default,"hammer","14oz carpenter's hammer",0.875),
+ (default,"hammer","16oz carpenter's hammer",1.0),
+ (default,"rocks","box of assorted rocks",5.3),
+ (default,"jacket","water resistent black wind breaker",0.1),
Review Comment:
Typo in inserted test data: "water resistent" is misspelled and should be
"water resistant" (even if this is only test DDL, keeping strings correct
avoids propagating typos across fixtures).
##########
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-mysql/src/main/java/org/apache/flink/cdc/connectors/mysql/source/reader/MySqlPipelineRecordEmitter.java:
##########
@@ -261,7 +266,10 @@ private Schema buildSchemaFromTable(Table table) {
for (int i = 0; i < columns.size(); i++) {
Column column = columns.get(i);
- String colName = column.name();
+ String colName =
+ this.isTableIdCaseInsensitive
+ ? column.name().toLowerCase(Locale.ROOT)
+ : column.name();
DataType dataType =
Review Comment:
The new case-normalization logic for column names/primary keys is gated by
`isTableIdCaseInsensitive`, but there doesn't appear to be test coverage for
the bounded snapshot (StartupOptions.snapshot()) path where schemas are fetched
via SHOW CREATE TABLE/DESC. Consider adding an IT that runs with
`StartupOptions.snapshot()` against a table with uppercase column names (and
PK) to exercise this end-to-end.
--
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]