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_r388753743
 
 

 ##########
 File path: 
flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonRowDeserializationSchema.java
 ##########
 @@ -351,76 +377,131 @@ private DeserializationRuntimeConverter 
createFallbackConverter(Class<?> valueTy
                }
        }
 
+       private float convertToFloat(ObjectMapper mapper, JsonNode jsonNode) {
+               try {
+                       return Float.parseFloat(jsonNode.asText().trim());
+               } catch (NumberFormatException e) {
+                       throw createParseErrorException("Unable to deserialize 
float.", e);
 
 Review comment:
   What result should we return if we just ignore the parse exception here? It 
seems that throwing an exception may be a good choice. What do you think? 
@wuchong 

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


With regards,
Apache Git Services

Reply via email to