snuyanzin commented on code in PR #19637: URL: https://github.com/apache/flink/pull/19637#discussion_r1145512436
########## flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/utils/ValuesOperationFactory.java: ########## @@ -197,10 +199,18 @@ private Optional<ResolvedExpression> convertToExpectedType( && targetLogicalType.is(ARRAY)) { return convertArrayToExpectedType( sourceExpression, (CollectionDataType) targetDataType, postResolverFactory); - } else if (functionDefinition == BuiltInFunctionDefinitions.MAP - && targetLogicalType.is(MAP)) { - return convertMapToExpectedType( - sourceExpression, (KeyValueDataType) targetDataType, postResolverFactory); + } else if (functionDefinition == BuiltInFunctionDefinitions.MAP) { + if (targetLogicalType.is(MAP)) { Review Comment: It seems the issue is that on api level `org.apache.flink.table.expressions.ApiExpressionUtils#objectToExpression` [1][2] translates maps to `MAP`. And both `MAP` and `MULTISET` are represented as maps there... [1] https://github.com/apache/flink/blob/e91eb5ec2fea9a2f28f3f55a06bc140e4ce4b5f5/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/ApiExpressionUtils.java#L85-L104 [2] https://github.com/apache/flink/blob/e91eb5ec2fea9a2f28f3f55a06bc140e4ce4b5f5/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/ApiExpressionUtils.java#L126-L137 -- 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