tweise commented on code in PR #23887:
URL: https://github.com/apache/flink/pull/23887#discussion_r1420897743


##########
flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/vector/reader/TimestampColumnReader.java:
##########
@@ -109,6 +157,37 @@ public static TimestampData int96ToTimestamp(
         }
     }
 
+    public static TimestampData int64ToTimestamp(
+            boolean utcTimestamp, long value, LogicalTypeAnnotation.TimeUnit 
timeUnit) {
+        long nanosOfMillisecond = 0L;
+        long milliseconds = 0L;
+
+        switch (timeUnit) {
+            case MILLIS:
+                milliseconds = value;
+                nanosOfMillisecond = value % MILLIS_PER_SECOND * 
NANOS_PER_MILLISECOND;
+                break;
+            case MICROS:
+                milliseconds = value / MICROS_PER_MILLISECOND;
+                nanosOfMillisecond = (value % MICROS_PER_SECOND) * 
NANOS_PER_MICROSECONDS;
+                break;
+            case NANOS:
+                milliseconds = value / NANOS_PER_MILLISECOND;
+                nanosOfMillisecond = value % NANOS_PER_SECOND;
+                break;
+            default:
+                break;

Review Comment:
   Good catch. LogicalTypeAnnotation.TimeUnit has only the 3 values that are 
all covered, so there should neither be a practical danger of dropping the 
value nor big risk of throwing an exception under default for clarity. It is 
also more of a stylistic concern that we can deal with in the master branch. I 
will open a PR there.



-- 
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...@flink.apache.org

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

Reply via email to