rdblue commented on code in PR #9008: URL: https://github.com/apache/iceberg/pull/9008#discussion_r1697461646
########## api/src/main/java/org/apache/iceberg/expressions/Literals.java: ########## @@ -453,6 +458,34 @@ protected Type.TypeID typeId() { } } + static class TimestampNanoLiteral extends ComparableLiteral<Long> { + TimestampNanoLiteral(Long value) { + super(value); + } + + @Override + @SuppressWarnings("unchecked") + public <T> Literal<T> to(Type type) { + switch (type.typeId()) { + case DATE: + return (Literal<T>) + new DateLiteral( + (int) ChronoUnit.DAYS.between(EPOCH_DAY, EPOCH.plusNanos(value()).toLocalDate())); Review Comment: Is there a DateTimeUtil` method for this? Seems like it would be better to colocate the logic 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...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org