rdblue commented on code in PR #9008:
URL: https://github.com/apache/iceberg/pull/9008#discussion_r1558253135
##########
api/src/main/java/org/apache/iceberg/expressions/Literals.java:
##########
@@ -515,6 +548,21 @@ public <T> Literal<T> to(Type type) {
return (Literal<T>) new TimestampLiteral(timestampMicros);
}
+ case TIMESTAMP_NANO:
+ if (((Types.TimestampNanoType) type).shouldAdjustToUTC()) {
+ long timestampNanos =
+ ChronoUnit.NANOS.between(
+ EPOCH, OffsetDateTime.parse(value(),
DateTimeFormatter.ISO_DATE_TIME));
+ return (Literal<T>) new TimestampNanoLiteral(timestampNanos);
Review Comment:
Can this be a method in `DateTimeUtil`? I think that's a good place to put
it.
--
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]