yangshangqing95 commented on code in PR #17750:
URL: https://github.com/apache/iceberg/pull/17750#discussion_r3846152506
##########
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:
Hi @pvary , this is something I also considered during the design. I prefer:
```
return Timestamp.from(
DateTimeUtil.timestamptzFromMicros((Long) icebergLiteral).toInstant());
```
This allows us to reuse DateTimeUtil instead of hard-coding the conversion
logic.
To avoid unnecessarily expanding the scope of this PR, I initially decided
not to change the micro timestamp-related code. My plan was to submit a
separate PR for this code-style cleanup after this PR is approved or merged.
That said, you make a good point. This is probably too minor a change to
justify a separate PR, so I'm happy to include it in this one as well.
For now, though, we can wait for @uros-b's response, as there seems to be a
stale duplicate PR addressing the same issue.
--
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]