TyrantLucifer commented on code in PR #6601:
URL: https://github.com/apache/seatunnel/pull/6601#discussion_r1548860630


##########
seatunnel-formats/seatunnel-format-text/src/main/java/org/apache/seatunnel/format/text/TextDeserializationSchema.java:
##########
@@ -235,21 +242,39 @@ private Object convert(String field, SeaTunnelDataType<?> 
fieldType, int level)
             case BYTES:
                 return field.getBytes(StandardCharsets.UTF_8);
             case DATE:
-                return DateUtils.parse(field, dateFormatter);
+                DateTimeFormatter dateFormatter = 
fieldFormatterMap.get(fieldName);
+                if (dateFormatter == null) {
+                    dateFormatter = DateUtils.matchDateTimeFormatter(field);
+                    fieldFormatterMap.put(fieldName, dateFormatter);
+                }
+
+                return 
dateFormatter.parse(field).query(TemporalQueries.localDate());
             case TIME:
-                return TimeUtils.parse(field, timeFormatter);
+                TemporalAccessor parsedTime = TIME_FORMAT.parse(field);
+                return parsedTime.query(TemporalQueries.localTime());
             case TIMESTAMP:

Review Comment:
   Why change this logic? What are the benefits?



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