zoudan 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_r385151530
##########
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:
When we set ignoreParseErrors=true and failOnMissingField=true, what is the
expected behavior if we encounter an invalid json string like "DDD" ? Fail the
job or swallow the exception?
----------------------------------------------------------------
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]
With regards,
Apache Git Services