ashulin commented on code in PR #2637:
URL:
https://github.com/apache/incubator-seatunnel/pull/2637#discussion_r970713003
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/common/serialization/InternalRowConverter.java:
##########
@@ -74,13 +73,12 @@ private static Object convert(Object field,
SeaTunnelDataType<?> dataType) {
SeaTunnelRowType rowType = (SeaTunnelRowType) dataType;
return convert(seaTunnelRow, rowType);
case DATE:
- return Date.valueOf((LocalDate) field);
+ return (int) ((LocalDate) field).toEpochDay();
case TIME:
- //TODO: how reconvert?
- LocalTime localTime = (LocalTime) field;
- return
Timestamp.valueOf(LocalDateTime.of(LocalDate.ofEpochDay(0), localTime));
+ // TODO: how reconvert? there are not Support for Spark
Type,we must define the Type in spark
+ throw new RuntimeException("we not support for time type now");
Review Comment:
```suggestion
// TODO: Support TIME Type
throw new RuntimeException("time type is not supported now,
but will be supported in the future.");
```
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/common/serialization/InternalRowConverter.java:
##########
@@ -167,11 +167,12 @@ 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);
case TIME:
- return ((Timestamp) field).toLocalDateTime().toLocalTime();
+ // todo: support this Type
+ throw new RuntimeException("time type not support now but
will");
Review Comment:
```suggestion
// TODO: Support TIME Type
throw new RuntimeException("time type is not supported now,
but will be supported in the future.");
```
--
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]