You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/10/06 08:10:46 UTC

[GitHub] [flink] wangxlong opened a new pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

wangxlong opened a new pull request #13543:
URL: https://github.com/apache/flink/pull/13543


   
   ## What is the purpose of the change
   
   Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset
   
   ## Brief change log
   Add the determination of  multiset type for JsonToRowDataConverters#createMapConverter and RowDataToJsonConverters#createMapConverter
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   JsonRowDataSerDeSchemaTest#testSerDe
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] wangxlong commented on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
wangxlong commented on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-706473302


   @wuchong 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:
users@infra.apache.org



[GitHub] [flink] wuchong commented on a change in pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #13543:
URL: https://github.com/apache/flink/pull/13543#discussion_r502208764



##########
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:
       The same to above. 

##########
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:
       I would suggest to change the method parameters to `createMapConverter(String typeSummary, LogicalType keyType, LogicalType valueType)` and move the above code out of the method (i.e. move to the switch case block). This can make the method `createMapConverter` more generic. 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704118940


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227",
       "triggerID" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "triggerType" : "PUSH"
     }, {
       "hash" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7320",
       "triggerID" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dc67b6de989014afbd682540d88867b4a4b027ed Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227) 
   * 943ce138bc7e39dad85260bebf628f52f12d0a04 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7320) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] wuchong commented on a change in pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #13543:
URL: https://github.com/apache/flink/pull/13543#discussion_r502733151



##########
File path: flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonToRowDataConverters.java
##########
@@ -300,22 +305,12 @@ private JsonToRowDataConverter createArrayConverter(ArrayType arrayType) {
 		};
 	}
 
-	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();
-		}
+	private JsonToRowDataConverter createMapConverter(
+		String typeSummary, LogicalType keyType, LogicalType valueType) {

Review comment:
       Add one more indent for parameters if they start a new line. 

##########
File path: flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonToRowDataConverters.java
##########
@@ -300,22 +305,12 @@ private JsonToRowDataConverter createArrayConverter(ArrayType arrayType) {
 		};
 	}
 
-	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();
-		}
+	private JsonToRowDataConverter createMapConverter(
+		String typeSummary, LogicalType keyType, LogicalType valueType) {
 		if (!LogicalTypeChecks.hasFamily(keyType, LogicalTypeFamily.CHARACTER_STRING)) {
 			throw new UnsupportedOperationException(
 				"JSON format doesn't support non-string as key type of map. " +
-					"The map type is: " + type.asSummaryString());
+					"The map type is: " + typeSummary);

Review comment:
       ```suggestion
   					"The type is: " + typeSummary);
   ```

##########
File path: flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/RowDataToJsonConverters.java
##########
@@ -218,14 +225,13 @@ private RowDataToJsonConverter createArrayConverter(ArrayType type) {
 		};
 	}
 
-	private RowDataToJsonConverter createMapConverter(MapType type) {
-		LogicalType keyType = type.getKeyType();
+	private RowDataToJsonConverter createMapConverter(
+		String typeSummary, LogicalType keyType, LogicalType valueType) {
 		if (!LogicalTypeChecks.hasFamily(keyType, LogicalTypeFamily.CHARACTER_STRING)) {
 			throw new UnsupportedOperationException(
 				"JSON format doesn't support non-string as key type of map. " +
-					"The map type is: " + type.asSummaryString());
+					"The map type is: " + typeSummary);

Review comment:
       ```suggestion
   					"The type is: " + typeSummary);
   ```

##########
File path: flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/RowDataToJsonConverters.java
##########
@@ -218,14 +225,13 @@ private RowDataToJsonConverter createArrayConverter(ArrayType type) {
 		};
 	}
 
-	private RowDataToJsonConverter createMapConverter(MapType type) {
-		LogicalType keyType = type.getKeyType();
+	private RowDataToJsonConverter createMapConverter(
+		String typeSummary, LogicalType keyType, LogicalType valueType) {

Review comment:
       Add one more indent for parameters if they start a new line.
   
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704118940


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227",
       "triggerID" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dc67b6de989014afbd682540d88867b4a4b027ed Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704118940


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227",
       "triggerID" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "triggerType" : "PUSH"
     }, {
       "hash" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7320",
       "triggerID" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 943ce138bc7e39dad85260bebf628f52f12d0a04 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7320) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704118940


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227",
       "triggerID" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "triggerType" : "PUSH"
     }, {
       "hash" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7320",
       "triggerID" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1603eee07aa5af3a14571cf4301311504ac83e71",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7357",
       "triggerID" : "1603eee07aa5af3a14571cf4301311504ac83e71",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 943ce138bc7e39dad85260bebf628f52f12d0a04 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7320) 
   * 1603eee07aa5af3a14571cf4301311504ac83e71 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7357) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704118940


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227",
       "triggerID" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "triggerType" : "PUSH"
     }, {
       "hash" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dc67b6de989014afbd682540d88867b4a4b027ed Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227) 
   * 943ce138bc7e39dad85260bebf628f52f12d0a04 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704107779


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit dc67b6de989014afbd682540d88867b4a4b027ed (Tue Oct 06 08:12:48 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-19509).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704118940


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dc67b6de989014afbd682540d88867b4a4b027ed UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704118940


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227",
       "triggerID" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "triggerType" : "PUSH"
     }, {
       "hash" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7320",
       "triggerID" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1603eee07aa5af3a14571cf4301311504ac83e71",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7357",
       "triggerID" : "1603eee07aa5af3a14571cf4301311504ac83e71",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1603eee07aa5af3a14571cf4301311504ac83e71 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7357) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] wuchong commented on a change in pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #13543:
URL: https://github.com/apache/flink/pull/13543#discussion_r502208764



##########
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:
       The same to above. 

##########
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:
       I would suggest to change the method parameters to `createMapConverter(String typeSummary, LogicalType keyType, LogicalType valueType)` and move the above code out of the method (i.e. move to the switch case block). This can make the method `createMapConverter` more generic. 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704118940






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] wangxlong commented on a change in pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [flink] wangxlong commented on a change in pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [flink] wuchong commented on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-706507302


   Merging...


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] wuchong merged pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
wuchong merged pull request #13543:
URL: https://github.com/apache/flink/pull/13543


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13543: [FLINK-19509][Format-json] Fix ClassCastException of JsonRowDataDeserializationSchema and JsonRowDataSerializationSchema when type is multiset

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13543:
URL: https://github.com/apache/flink/pull/13543#issuecomment-704118940


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7227",
       "triggerID" : "dc67b6de989014afbd682540d88867b4a4b027ed",
       "triggerType" : "PUSH"
     }, {
       "hash" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7320",
       "triggerID" : "943ce138bc7e39dad85260bebf628f52f12d0a04",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1603eee07aa5af3a14571cf4301311504ac83e71",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1603eee07aa5af3a14571cf4301311504ac83e71",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 943ce138bc7e39dad85260bebf628f52f12d0a04 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7320) 
   * 1603eee07aa5af3a14571cf4301311504ac83e71 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org