linguoxuan opened a new pull request, #4425: URL: https://github.com/apache/flink-cdc/pull/4425
When the StarRocks pipeline connector builds DDL statements (CREATE TABLE / ALTER TABLE ADD COLUMN), special characters in column comments and default values (such as backslash `\`, double quote `"`, newline `\n`, carriage return `\r`) are not properly escaped. This causes the generated DDL to be syntactically invalid, leading to schema synchronization failures at runtime. ### Root Cause The column comment and default value strings are directly interpolated into the DDL template `DEFAULT "..."` and `COMMENT "..."` without any escaping. ### Fix Introduce a utility method `StarRocksUtils.escapeSqlStringLiteral()` that escapes: - `\` → `\\` - `"` → `""` - `\n` / `\r` → space Apply this escaping in: - `StarRocksEnrichedCatalog` (CREATE TABLE DDL building) - `StarRocksMetadataApplier` (ALTER TABLE ADD COLUMN) - `StarRocksUtils` (initial schema conversion and table comment) -- 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]
