-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed as not planned
Labels
Description
When trying to write to a field with type Types.TimestampType.withoutZone(), I'm getting the exception
java.time.LocalDateTime cannot be cast to java.time.OffsetDateTime.
This appears to be due to a case match miss in the GenericParquetWriter - for all primitives of type TIMESTAMP_MICROS, the TimestamptzWriter is returned. I believe it should only be returned when shouldAdjustToUTC is true; and the TimestampWriter returned otherwise (similar to the implementation in GenericParquetReaders).
in GenericParquetWriter:
case TIMESTAMP_MICROS:
return new TimestamptzWriter(desc);
in GenericParquetReader:
case TIMESTAMP_MICROS:
TimestampType tsMicrosType = (TimestampType)expected;
if (tsMicrosType.shouldAdjustToUTC()) {
return new GenericParquetReaders.TimestamptzReader(desc);
}
return new GenericParquetReaders.TimestampReader(desc);