slinkydeveloper commented on a change in pull request #18287:
URL: https://github.com/apache/flink/pull/18287#discussion_r780326206



##########
File path: 
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/CastFunctionITCase.java
##########
@@ -1142,14 +1146,27 @@ protected Configuration configuration() {
 
     public static List<TestSpec> constructedTypes() {
         return Arrays.asList(
-                // https://issues.apache.org/jira/browse/FLINK-17321
-                // MULTISET
-                // MAP
+                CastTestSpecBuilder.testCastTo(MAP(STRING(), STRING()))
+                        .fromCase(MAP(FLOAT(), DOUBLE()), null, null)
+                        .fromCase(
+                                MAP(INT(), INT()),
+                                Collections.singletonMap(1, 2),
+                                Collections.singletonMap("1", "2"))

Review comment:
       :thinking: I'm surprised that this works without changing anything in 
`LogicalTypeCasts`... Can you add a test case for failure? For example:
   
   ```
   CastTestSpecBuilder
     .testCastTo(MAP(STRING(), STRING()))
     .fail(MAP(STRING(), ROW(INT())), whateverValue)
   ```
   
   Same for ROW to ROW and ARRAY to ARRAY. Just take whatever inner invalid 
tuple and see what exception you get. If it fails within the single `CastRule` 
implementations, then something is wrong with `LogicalTypeCasts`.




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