kingeasternsun commented on a change in pull request #3987:
URL: https://github.com/apache/iceberg/pull/3987#discussion_r801392317
##########
File path:
flink/v1.13/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetReaders.java
##########
@@ -321,6 +327,29 @@ public DecimalData read(DecimalData ignored) {
}
}
+ private static class TimestampInt96Reader extends
ParquetValueReaders.UnboxedReader<Long> {
+ private static final long UNIX_EPOCH_JULIAN = 2_440_588L;
+
+ TimestampInt96Reader(ColumnDescriptor desc) {
+ super(desc);
+ }
+
+ @Override
+ public Long read(Long ignored) {
+ return readLong();
+ }
+
+ @Override
+ public long readLong() {
+ final ByteBuffer byteBuffer =
column.nextBinary().toByteBuffer().order(ByteOrder.LITTLE_ENDIAN);
+ final long timeOfDayNanos = byteBuffer.getLong();
+ final int julianDay = byteBuffer.getInt();
+
+ return TimeUnit.DAYS.toMicros(julianDay - UNIX_EPOCH_JULIAN) +
+ TimeUnit.NANOSECONDS.toMicros(timeOfDayNanos);
Review comment:
> Nit: This is over indented. For an expression that spans multiple
lines, the second line on should be indented 4 spaces from the start of the
first.
>
> So like this:
>
> ```java
> return TimeUnit.DAYS.toMicros(julianDay - UNIX_EPOCH_JULIAN) +
> TimeUnit.NANOSECONDS.toMicros(timeOfDayNanos);
> ```
>
> If you weren't aware, there's an intellij (and I believe eclipse) code
auto formatting rule file which would catch this. It probably works with other
tools as well:
https://iceberg.apache.org/#community/#configuring-code-formatter-for-intellij-idea
https://github.com/gustavoatt/iceberg/blob/master/spark/src/main/java/org/apache/iceberg/spark/data/SparkParquetReaders.java#L382
; Should I format this code as well?
--
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]