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/02/27 13:15:11 UTC

[GitHub] [flink] wuchong commented on a change in pull request #11119: [FLINK-15396][json] Support to ignore parse errors for JSON format

wuchong commented on a change in pull request #11119: [FLINK-15396][json] Support to ignore parse errors for JSON format
URL: https://github.com/apache/flink/pull/11119#discussion_r385117397
 
 

 ##########
 File path: flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonRowDeserializationSchema.java
 ##########
 @@ -130,6 +135,9 @@ public Row deserialize(byte[] message) throws IOException {
 			final JsonNode root = objectMapper.readTree(message);
 			return (Row) runtimeConverter.convert(objectMapper, root);
 		} catch (Throwable t) {
+			if (ignoreParseErrors) {
+				return null;
+			}
 
 Review comment:
   It ignores all exceptions including the exception which may be not a parsing errors. For example, if `ignoreParseErrors=true` and `failOnMissingField=true`, the missing field exception will be swallowed. 
   
   I think we should check the exception in every converters to have a fine-grained exception ignoring.

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


With regards,
Apache Git Services