leonardBang commented on code in PR #3557:
URL: https://github.com/apache/flink-cdc/pull/3557#discussion_r1723178889


##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/parser/TransformParser.java:
##########
@@ -585,4 +590,95 @@ public static String normalizeFilter(String projection, 
String filter) {
             return filter;
         }
     }
+
+    public static boolean hasAsterisk(@Nullable String projection) {
+        if (isNullOrWhitespaceOnly(projection)) {
+            return false;
+        }
+        return parseProjectionExpression(projection).getOperandList().stream()
+                .anyMatch(TransformParser::hasAsterisk);
+    }
+
+    private static boolean hasAsterisk(SqlNode sqlNode) {
+        if (sqlNode instanceof SqlIdentifier) {
+            return ((SqlIdentifier) sqlNode).isStar();
+        } else if (sqlNode instanceof SqlBasicCall) {
+            SqlBasicCall sqlBasicCall = (SqlBasicCall) sqlNode;
+            return 
sqlBasicCall.getOperandList().stream().anyMatch(TransformParser::hasAsterisk);
+        } else if (sqlNode instanceof SqlNodeList) {
+            SqlNodeList sqlNodeList = (SqlNodeList) sqlNode;
+            return 
sqlNodeList.getList().stream().anyMatch(TransformParser::hasAsterisk);
+        } else {
+            return false;
+        }
+    }
+
+    public static Optional<SchemaChangeEvent> transformSchemaChangeEvent(

Review Comment:
   Well, I think the `transformSchemaChangeEvent` method should not stay in  
the `TransformParser ` class from code design perspective.



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

Reply via email to