You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/09/20 22:50:07 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #487: Add TIME_MICROS support to GenericParquetReaders

rdblue commented on a change in pull request #487: Add TIME_MICROS support to GenericParquetReaders
URL: https://github.com/apache/incubator-iceberg/pull/487#discussion_r326826386
 
 

 ##########
 File path: data/src/main/java/org/apache/iceberg/data/parquet/GenericParquetReaders.java
 ##########
 @@ -366,6 +365,15 @@ public OffsetDateTime read(OffsetDateTime reuse) {
     }
   }
 
+  private static class TimeReader extends PrimitiveReader<LocalTime> {
+    private TimeReader(ColumnDescriptor desc) {
+      super(desc);
+    }
+
+    @Override
+    public LocalTime read(LocalTime reuse) { return LocalTime.MIN.plus(column.nextLong(), ChronoUnit.MICROS); }
 
 Review comment:
   In other places, we use `LocalTime.ofNanoOfDay(decoder.readLong() * 1000L)`, so I'm not sure that this implementation is correct.
   
   Could you write a test that validates the conversion from microseconds to a time value? You can convert a time string to a microseconds value using `Literals.of("10:11:12.131415").to(TimeType.get()).value()`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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