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_r387498390
##########
File path:
flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonRowDeserializationSchema.java
##########
@@ -351,76 +379,187 @@ private DeserializationRuntimeConverter
createFallbackConverter(Class<?> valueTy
}
}
+ private boolean convertToBoolean(ObjectMapper mapper, JsonNode
jsonNode) {
+ try {
+ return jsonNode.asBoolean();
Review comment:
I find that other JsonNodes except BooleanNode will return a default 'false'
when we call 'asBoolean()' and not throw an exception. Other JsonNodes have
similar behaviors. I will modify this PR as we do not need to catch exceptions
when parsing JsonNode like this.
----------------------------------------------------------------
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