snuyanzin commented on a change in pull request #17786:
URL: https://github.com/apache/flink/pull/17786#discussion_r750069096



##########
File path: 
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/MapAndMultisetToStringCastRule.java
##########
@@ -109,16 +104,14 @@ protected String generateCodeBlockInternal(
             String returnVariable,
             LogicalType inputLogicalType,
             LogicalType targetLogicalType) {
-        boolean isMap = inputLogicalType instanceof MapType;
-        final LogicalType keyType;
-        final LogicalType valueType;
-        if (isMap) {
-            keyType = ((MapType) inputLogicalType).getKeyType();
-            valueType = ((MapType) inputLogicalType).getValueType();
-        } else {
-            keyType = ((MultisetType) inputLogicalType).getElementType();
-            valueType = INT().getLogicalType();
-        }
+        final LogicalType keyType =
+                inputLogicalType.is(LogicalTypeFamily.COLLECTION)

Review comment:
       ok, done, thanks




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to