hulincup commented on code in PR #28931:
URL: https://github.com/apache/flink/pull/28931#discussion_r3732716480


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/StringFunctionsITCase.java:
##########
@@ -182,6 +182,22 @@ private Stream<TestSetSpec> eltTestCases() {
                                 DataTypes.VARCHAR(5))
                         .testResult(
                                 lit(2).elt("a", "b"), "ELT(2, 'a', 'b')", "b", 
DataTypes.CHAR(1))
+                        // FLINK-40338: non-INT INTEGER_NUMERIC index must not 
throw ClassCastException
+                        .testResult(
+                                lit(2).cast(DataTypes.TINYINT()).elt("scala", 
"java"),
+                                "ELT(CAST(2 AS TINYINT), 'scala', 'java')",
+                                "java",
+                                DataTypes.VARCHAR(5))
+                        .testResult(
+                                lit(2).cast(DataTypes.SMALLINT()).elt("scala", 
"java"),
+                                "ELT(CAST(2 AS SMALLINT), 'scala', 'java')",
+                                "java",
+                                DataTypes.VARCHAR(5))
+                        .testResult(
+                                lit(2).cast(DataTypes.BIGINT()).elt("scala", 
"java"),
+                                "ELT(CAST(2 AS BIGINT), 'scala', 'java')",
+                                "java",
+                                DataTypes.VARCHAR(5))

Review Comment:
   Done — removed the redundant constant cases and added field-reference tests 
(`f4`/`f5`/`f6`) per your suggestion, so the codegen'd operator path is now 
covered alongside the reducer path. Thanks @SEPURI-SAI-KRISHNA for the verified 
patch and @raminqaf for catching the gap.



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