wangxlong commented on a change in pull request #13543:
URL: https://github.com/apache/flink/pull/13543#discussion_r502227879
##########
File path:
flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonToRowDataConverters.java
##########
@@ -298,15 +300,25 @@ private JsonToRowDataConverter
createArrayConverter(ArrayType arrayType) {
};
}
- private JsonToRowDataConverter createMapConverter(MapType mapType) {
- LogicalType keyType = mapType.getKeyType();
+ private JsonToRowDataConverter createMapConverter(LogicalType type) {
+ LogicalType keyType;
+ LogicalType valueType;
+ if (type instanceof MapType) {
+ MapType mapType = (MapType) type;
+ keyType = mapType.getKeyType();
+ valueType = mapType.getValueType();
+ } else {
+ MultisetType multisetType = (MultisetType) type;
+ keyType = multisetType.getElementType();
+ valueType = new IntType();
+ }
Review comment:
Good idea. Updated.
##########
File path:
flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/RowDataToJsonConverters.java
##########
@@ -218,14 +220,23 @@ private RowDataToJsonConverter
createArrayConverter(ArrayType type) {
};
}
- private RowDataToJsonConverter createMapConverter(MapType type) {
- LogicalType keyType = type.getKeyType();
+ private RowDataToJsonConverter createMapConverter(LogicalType type) {
Review comment:
Updated~
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]