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


##########
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.",
+                            exMsgPrefix, identifier));
+        }
+        return identifier.getSimple();
+    }
+
+    public static List<TableChange> validateAndGatherDropWatermarkChanges(
+            ResolvedCatalogBaseTable<?> oldTable, String exMsgPrefix, String 
tableKindStr) {
+        if (oldTable.getResolvedSchema().getWatermarkSpecs().isEmpty()) {
+            throw new ValidationException(
+                    String.format(
+                            "%sThe current %s does not define any watermark 
strategy.",

Review Comment:
   similar comment . It will read strangely without a space before the first  
`The`



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