Copilot commented on code in PR #66950:
URL: https://github.com/apache/doris/pull/66950#discussion_r3818170489


##########
fe/fe-core/src/main/java/org/apache/doris/job/util/StreamingJobUtils.java:
##########
@@ -417,6 +418,13 @@ public static LinkedHashMap<String, CreateTableCommand> 
generateCreateTableCmds(
 
                 // Validate and apply exclude_columns for this table
                 Set<String> excludeColumns = parseExcludeColumns(properties, 
table);
+                if (targetDatabase.isTableExist(targetTableName)) {
+                    validateExcludedPrimaryKeys(excludeColumns, table, 
primaryKeys);
+                    createtblCmds.put(table, Optional.empty());
+                    continue;
+                }

Review Comment:
   When the mapped target table already exists, this new early-return path 
skips `validateExcludeColumns(...)`, so `exclude_columns` typos (non-existent 
columns) are no longer rejected at CREATE JOB time. At runtime 
`exclude_columns` is still consumed by the CDC client (e.g. 
`DebeziumJsonDeserializer`), so a typo would silently become a no-op and 
potentially leak columns the user intended to exclude.
   
   Consider still validating `exclude_columns` *names* (without doing JDBC 
type->Doris type mapping) before returning `Optional.empty()`, e.g. by fetching 
upstream column names via `jdbcClient.getJdbcColumnsInfo(database, table)` and 
checking membership, then applying the existing primary-key exclusion 
validation.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to