nandorKollar commented on code in PR #14266:
URL: https://github.com/apache/iceberg/pull/14266#discussion_r2424482780
##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetConversions.java:
##########
@@ -83,6 +83,9 @@ static Function<Object, Object> converterFromParquet(
} else if (icebergType.typeId() == Type.TypeID.DOUBLE
&& parquetType.getPrimitiveTypeName() ==
PrimitiveType.PrimitiveTypeName.FLOAT) {
return value -> ((Float) fromParquet.apply(value)).doubleValue();
+ } else if (icebergType.typeId() == Type.TypeID.TIMESTAMP
+ && parquetType.getOriginalType() ==
org.apache.parquet.schema.OriginalType.DATE) {
+ return value -> (long) ((Integer) fromParquet.apply(value)) *
86400_000_000L;
Review Comment:
nit: maybe `TimeUnit.DAYS.toMicros(1)` is a bit easier to understand than
`86400_000_000L`, or you can extract the value to a private constant. Also spec
allows promotion to timestamp nanos, should we also handle it here too?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]