yuxiqian commented on code in PR #3740:
URL: https://github.com/apache/flink-cdc/pull/3740#discussion_r1855853213


##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/parser/TransformParser.java:
##########
@@ -588,7 +585,8 @@ public static String normalizeFilter(String projection, 
String filter) {
 
     public static boolean hasAsterisk(@Nullable String projection) {
         if (isNullOrWhitespaceOnly(projection)) {
-            return false;
+            // Providing an empty projection expression is equivalent to 
writing `*` explicitly.
+            return true;

Review Comment:
   Please rebase with `master` as this has been resolved



##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/parser/TransformParser.java:
##########
@@ -123,10 +123,7 @@ private static RelNode sqlToRel(
                 if (udf.getReturnTypeHint() != null) {
                     // This UDF has return type hint annotation
                     returnTypeInference =
-                            o ->
-                                    o.getTypeFactory()
-                                            .createSqlType(
-                                                    
convertCalciteType(udf.getReturnTypeHint()));
+                            o -> convertCalciteType(o.getTypeFactory(), 
udf.getReturnTypeHint());

Review Comment:
   Could you please add some test cases on UDF return type inferences?



##########
flink-cdc-runtime/src/test/java/org/apache/flink/cdc/runtime/parser/TransformParserTest.java:
##########
@@ -316,12 +316,13 @@ public void testGenerateProjectionColumns() {
                         Column.physicalColumn("name", DataTypes.STRING(), 
"string"),
                         Column.physicalColumn("age", DataTypes.INT(), "age"),
                         Column.physicalColumn("address", DataTypes.STRING(), 
"address"),
+                        Column.physicalColumn("deposit", DataTypes.DECIMAL(10, 
2), "deposit"),
                         Column.physicalColumn("weight", DataTypes.DOUBLE(), 
"weight"),
                         Column.physicalColumn("height", DataTypes.DOUBLE(), 
"height"));
 
         List<ProjectionColumn> result =
                 TransformParser.generateProjectionColumns(
-                        "id, upper(name) as name, age + 1 as newage, weight / 
(height * height) as bmi",
+                        "id, upper(name) as name, age + 1 as newage, deposit 
as deposits, weight / (height * height) as bmi",

Review Comment:
   Please add some tests to verify if `VARCHAR`, `TIMESTAMP`-series types with 
precision works, too



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