You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/09/05 02:33:45 UTC

[GitHub] [incubator-seatunnel] liugddx commented on a diff in pull request #2637: [Bug][Translation] fix data,time,timestamp convert for spark

liugddx commented on code in PR #2637:
URL: https://github.com/apache/incubator-seatunnel/pull/2637#discussion_r962432658


##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/common/serialization/InternalRowConverter.java:
##########
@@ -164,11 +168,11 @@ private static Object reconvert(Object field, SeaTunnelDataType<?> dataType) {
             case ROW:
                 return reconvert((InternalRow) field, (SeaTunnelRowType) dataType);
             case DATE:
-                return ((Date) field).toLocalDate();
+                return LocalDate.ofEpochDay((int) field);

Review Comment:
   how about like this? `(int) ((Date.valueOf(String.valueOf(val))).toLocalDate().toEpochDay());`



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org