twalthr commented on code in PR #28448:
URL: https://github.com/apache/flink/pull/28448#discussion_r3414243815


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/ProcessTableFunctionTestPrograms.java:
##########
@@ -1940,4 +1941,24 @@ public class ProcessTableFunctionTestPrograms {
                                     + "in2 => TABLE t_large PARTITION BY name 
ORDER BY (ts ASC, score DESC), "
                                     + "on_time => DESCRIPTOR(ts))")
                     .build();
+
+    public static final TableTestProgram PROCESS_IMPLICIT_CASTS =
+            TableTestProgram.of(
+                            "process-implicit-casts",
+                            "implicits casts for both scalar and table args")
+                    .setupTemporarySystemFunction("f", 
ImplicitCastingFunction.class)
+                    .setupSql(
+                            "CREATE VIEW v AS SELECT 'Bob', 12, (42, TIMESTAMP 
'2020-01-01 12:12:12')")
+                    .setupTableSink(
+                            SinkTestStep.newBuilder("sink")
+                                    .addSchema(BASE_SINK_SCHEMA)
+                                    .consumedValues(
+                                            "+I[{CastingPojo[s=Bob, b=12, 
r=+I[42, 2020-01-01T12:12:12]], 42}]")
+                                    .build())
+                    // The function expects wider types (BIGINT and 
TIMESTAMP(6)),
+                    // implicit casts are added to fix the mismatch between 
INT vs. BIGINT and
+                    // TIMESTAMP(0) vs. TIMESTAMP(6).
+                    // Also in constructed types: ROW (table input) vs. 
STRUCTURED (expected).
+                    .runSql("INSERT INTO sink SELECT * FROM f(p => TABLE v, b 
=> 42, d => 12)")
+                    .build();

Review Comment:
   Sorry I pushed the wrong commit.



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