Shawn-Hx commented on code in PR #3939: URL: https://github.com/apache/flink-cdc/pull/3939#discussion_r1986690929
########## flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/parser/TransformParser.java: ########## @@ -642,4 +654,16 @@ private static boolean hasAsterisk(SqlNode sqlNode) { return false; } } + + public static Map<String, String> generateColumnNameMap(List<String> originalColumnNames) { + int i = 0; + Map<String, String> columnNameMap = new HashMap<>(); + for (String columnName : originalColumnNames) { + if (!columnNameMap.containsKey(columnName)) { + columnNameMap.put(columnName, MAPPED_COLUMN_NAME_PREFIX + i); + i++; + } + } + return columnNameMap; + } Review Comment: I prefer option 3. For option 1, seems it is not very easy to judge a column name is legal or not considering every java keyword is illegal. For option 2, a corner case is there are two columns named `a-b` and `a.b` and we still cannot recognize them after mapping. Have added column name map information to the exception log. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org