pvary commented on code in PR #17750:
URL: https://github.com/apache/iceberg/pull/17750#discussion_r3842486576


##########
orc/src/main/java/org/apache/iceberg/orc/ExpressionToSearchArgument.java:
##########
@@ -333,6 +335,8 @@ private <T> Object literal(Type icebergType, T 
icebergLiteral) {
             Instant.ofEpochSecond(
                 Math.floorDiv(microsFromEpoch, 1_000_000),
                 Math.floorMod(microsFromEpoch, 1_000_000) * 1_000L));
+      case TIMESTAMP_NANO:
+        return Timestamp.from(DateTimeUtil.timestamptzFromNanos((Long) 
icebergLiteral).toInstant());

Review Comment:
   Could we do the same for the Timestamp, or use the same pattern here that we 
use there?
   ```
     long nanosFromEpoch = (Long) icebergLiteral;
     return Timestamp.from(
         Instant.ofEpochSecond(
             Math.floorDiv(nanosFromEpoch, 1_000_000_000),
             Math.floorMod(nanosFromEpoch, 1_000_000_000)));
   ```
   or
   ```
           return Timestamp.from(
               DateTimeUtil.timestamptzFromMicros((Long) 
icebergLiteral).toInstant());
   ```



-- 
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]

Reply via email to