ajantha-bhat commented on code in PR #11904:
URL: https://github.com/apache/iceberg/pull/11904#discussion_r1925683533
##########
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:
I see. In that case I feel maybe previous changes of separate factory method
before https://github.com/apache/iceberg/pull/11904#discussion_r1917285311 was
more suitable.
--
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]