davidradl commented on code in PR #27381:
URL: https://github.com/apache/flink/pull/27381#discussion_r2660935211


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/utils/OperationConverterUtils.java:
##########
@@ -69,4 +86,153 @@ public static String getQuotedSqlString(SqlNode sqlNode, 
FlinkPlannerImpl flinkP
                                 
.withIdentifierQuoteString(parserConfig.quoting().string));
         return sqlNode.toSqlString(dialect).getSql();
     }
+
+    public static Set<String> getColumnNames(SqlNodeList sqlNodeList, String 
errMsgPrefix) {
+        Set<String> distinctNames = new HashSet<>();
+        for (SqlNode sqlNode : sqlNodeList) {
+            String name = extractSimpleColumnName((SqlIdentifier) sqlNode, 
errMsgPrefix);
+            if (!distinctNames.add(name)) {
+                throw new ValidationException(
+                        String.format("%sDuplicate column `%s`.", 
errMsgPrefix, name));
+            }
+        }
+        return distinctNames;
+    }
+
+    public static String extractSimpleColumnName(SqlIdentifier identifier, 
String exMsgPrefix) {
+        if (!identifier.isSimple()) {
+            throw new UnsupportedOperationException(
+                    String.format(
+                            "%sAlter nested row type %s is not supported yet.",

Review Comment:
   nit: from what I can see the  exMsgPrefix comes from the TableKind enum. So 
would read something like 
   `MATERIALIZED_TABLEAlter nested row ...`.
   
   I wonder if it would read better as `Alter %s nested row ... `
    



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

Reply via email to