LeonYoah commented on code in PR #7157:
URL: https://github.com/apache/seatunnel/pull/7157#discussion_r1675323721


##########
seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/JsonToRowConverters.java:
##########
@@ -250,6 +250,9 @@ private float convertToFloat(JsonNode jsonNode) {
     }
 
     private LocalDate convertToLocalDate(JsonNode jsonNode, String fieldName) {
+        if ("".equals(jsonNode.asText())) {
+            return null;
+        }

Review Comment:
   > I want to confirm one thing first, is the data in kafka `""` or `null`? If 
it is `null`, we should continue. If it is `""`, I think it is normal to report 
an error. Please refer #7181
   
   I have read your pr, your design is very good, it is no problem to throw 
wrong theory, but there is another scenario you need to consider, that is, a 
batch of data sent from upstream, for example, 
{"date_field":"2023-02-01"},{"date_field":""}, should we return empty strings 
or pass null to the downstream database instead of parsing them?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to