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 04:29:17 UTC
[GitHub] [incubator-seatunnel] laglangyue commented on a diff in pull request #2637: [Bug][Translation] fix data,time,timestamp convert for spark
laglangyue commented on code in PR #2637:
URL: https://github.com/apache/incubator-seatunnel/pull/2637#discussion_r962466539
##########
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:
> (int) ((Date.valueOf(String.valueOf(val))).toLocalDate().toEpochDay());
the value is int in sparkRow, and transfrom it to LocalDate.
--
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