rdblue commented on code in PR #11904:
URL: https://github.com/apache/iceberg/pull/11904#discussion_r1924336176


##########
parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetReaders.java:
##########
@@ -76,6 +80,46 @@ protected ParquetValueReader<T> createReader(
   protected abstract ParquetValueReader<T> createStructReader(
       List<Type> types, List<ParquetValueReader<?>> fieldReaders, 
Types.StructType structType);
 
+  protected ParquetValueReader<?> fixedReader(ColumnDescriptor desc) {
+    return new FixedReader(desc);
+  }
+
+  protected ParquetValueReader<?> dateReader(ColumnDescriptor desc) {
+    return new DateReader(desc);
+  }
+
+  protected ParquetValueReader<?> timeReader(
+      ColumnDescriptor desc, LogicalTypeAnnotation.TimeUnit unit) {
+    switch (unit) {
+      case MICROS:
+        return new TimeReader(desc);
+      case MILLIS:
+        return new TimeMillisReader(desc);
+      default:
+        throw new UnsupportedOperationException("Unsupported Unit: " + unit);
+    }
+  }
+
+  protected ParquetValueReader<?> timestampReader(
+      ColumnDescriptor desc, LogicalTypeAnnotation.TimeUnit unit, boolean 
isAdjustedToUTC) {
+    switch (unit) {
+      case MICROS:
+        return isAdjustedToUTC ? new TimestamptzReader(desc) : new 
TimestampReader(desc);
+      case MILLIS:
+        return isAdjustedToUTC
+            ? new TimestamptzMillisReader(desc)
+            : new TimestampMillisReader(desc);
+      case NANOS:
+        if (isAdjustedToUTC) {
+          return new TimestampInt96Reader(desc);

Review Comment:
   This isn't correct. The INT96 timestamp reader is used when the underlying 
type is INT96, not when the Iceberg or Parquet type has nanosecond precision. 
Nanosecond precision timestamps were recently introduced and are not used to 
signal that Parquet stores timestamp as an INT96.
   
   This should match the previous behavior, where this is used when underlying 
physical type (`desc.getPrimitiveType().getPrimitiveTypeName()`) is INT96.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to