nandorKollar commented on code in PR #15159:
URL: https://github.com/apache/iceberg/pull/15159#discussion_r2930676422


##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetConversions.java:
##########
@@ -82,6 +86,24 @@ 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) {
+        LogicalTypeAnnotation logicalType = 
parquetType.getLogicalTypeAnnotation();
+        if (logicalType instanceof 
LogicalTypeAnnotation.TimestampLogicalTypeAnnotation
+            && ((LogicalTypeAnnotation.TimestampLogicalTypeAnnotation) 
logicalType)
+                .isAdjustedToUTC()) {
+          return fromParquet;
+        }

Review Comment:
   This is a good catch! `parquetType` can't have `OriginaType` Date and 
`LogicalType` `Timestamp` at the same time. I guess the intent here was to 
verify that 'Promotion to timestamptz or timestamptz_ns is not allowed', but 
for that, the UTC flag needs to be checked in the Iceberg type I think.



-- 
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]

Reply via email to