Copilot commented on code in PR #61317:
URL: https://github.com/apache/doris/pull/61317#discussion_r2963653258
##########
fe/fe-core/src/main/java/org/apache/doris/job/util/StreamingJobUtils.java:
##########
@@ -322,6 +332,12 @@ public static List<CreateTableCommand>
generateCreateTableCmds(String targetDb,
noPrimaryKeyTables.add(table);
}
+ // Resolve target (Doris) table name; defaults to source table
name if not configured
+ String targetTableName = properties.getOrDefault(
+ DataSourceConfigKeys.TABLE + "." + table + "."
+ + DataSourceConfigKeys.TABLE_TARGET_TABLE_SUFFIX,
+ table);
Review Comment:
`targetTableName` is taken directly from properties without
trimming/normalization. Since job properties often come from user input,
leading/trailing whitespace can produce an invalid Doris table name (or a
hard-to-debug mismatch with runtime routing). Consider `trim()`ing the
configured value (and rejecting blank-after-trim) before using it as the
CreateTableInfo tableName.
```suggestion
String rawTargetTableName = properties.getOrDefault(
DataSourceConfigKeys.TABLE + "." + table + "."
+ DataSourceConfigKeys.TABLE_TARGET_TABLE_SUFFIX,
table);
String targetTableName =
StringUtils.trimToNull(rawTargetTableName);
if (targetTableName == null) {
throw new JobException("Target table name for source table
'" + table
+ "' is blank or contains only whitespace");
}
```
##########
fs_brokers/cdc_client/src/main/java/org/apache/doris/cdcclient/utils/ConfigUtil.java:
##########
@@ -169,6 +169,31 @@ public static Map<String, Set<String>>
parseAllExcludeColumns(Map<String, String
return result;
}
+ /**
+ * Parse all target-table name mappings from config.
+ *
+ * <p>Scans all keys matching {@code "table.<srcTableName>.target_table"}
and returns a map from
+ * source table name to target (Doris) table name. Tables without a
mapping are NOT included;
+ * callers should use {@code getOrDefault(srcTable, srcTable)}.
+ */
+ public static Map<String, String> parseAllTargetTableMappings(Map<String,
String> config) {
Review Comment:
The new Javadoc block is mis-indented (extra leading spaces before `/**`),
which is likely to fail googleJavaFormat/Spotless for this module. Please align
the comment indentation with surrounding methods.
--
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]