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


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/ExprCodeGenerator.scala:
##########
@@ -1177,10 +1203,15 @@ class ExprCodeGenerator(
       case ELEMENT =>
         val array = operands.head
         requireArray(array)
-        generateArrayElement(ctx, array)
+        generateArrayElement(ctx, array, resultType)
+
+      case ELEMENT_V1 =>
+        val array = operands.head
+        requireArray(array)
+        generateArrayElement(ctx, array, elementTypeV1(operands, resultType))
 
       case DOT =>
-        generateDot(ctx, operands)
+        generateDot(ctx, operands, resultType)

Review Comment:
   isn't the versioning missing here?



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/common/CalcTestPrograms.java:
##########
@@ -315,6 +316,44 @@ public class CalcTestPrograms {
                             "INSERT INTO sink_t SELECT PARSE_JSON(s), 
TRY_PARSE_JSON(s), v['k'] FROM t")
                     .build();
 
+    /**
+     * Restores a plan with version 1 of ITEM and ELEMENT, which returns the 
default value of the
+     * element type instead of NULL for a missing element of a NOT NULL type. 
Regenerating the plan
+     * would compile version 2.
+     */
+    public static final TableTestProgram CALC_MISSING_ELEMENT_V1 =

Review Comment:
   can we split this test into a dedicated ELEMENT_V1 and ITEM_V1 test.



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/serde/RexNodeJsonSerdeTest.java:
##########
@@ -363,6 +365,42 @@ public void testMissingVersionOfInternalFunction() throws 
IOException {
                                         + "Only the latest version '$<$1' is 
available."));
     }
 
+    @ParameterizedTest
+    @MethodSource("versionedOperators")
+    public void testVersionedOperator(RexCall call, SqlOperator operatorV1) 
throws IOException {

Review Comment:
   Shall we drop this test? What is the goal of this test?



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/serde/RexNodeJsonSerdeTest.java:
##########
@@ -363,6 +365,42 @@ public void testMissingVersionOfInternalFunction() throws 
IOException {
                                         + "Only the latest version '$<$1' is 
available."));
     }
 
+    @ParameterizedTest
+    @MethodSource("versionedOperators")
+    public void testVersionedOperator(RexCall call, SqlOperator operatorV1) 
throws IOException {

Review Comment:
   The restore tests test V1, the current CollectionFunctionsITCase test V2.



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