rdblue commented on code in PR #9008: URL: https://github.com/apache/iceberg/pull/9008#discussion_r1483624801
########## api/src/main/java/org/apache/iceberg/expressions/ExpressionUtil.java: ########## @@ -564,14 +569,26 @@ private static String sanitizeDate(int days, int today) { return "(date)"; } - private static String sanitizeTimestamp(long micros, long now) { - String isPast = now > micros ? "ago" : "from-now"; - long diff = Math.abs(now - micros); - if (diff < FIVE_MINUTES_IN_MICROS) { + private static String sanitizeTimestamp(ChronoUnit unit, long timeUnits, long nowMillis) { + long timeMillis; + switch (unit) { + case MICROS: + timeMillis = DateTimeUtil.microsToMillis(timeUnits); + break; + case NANOS: + timeMillis = DateTimeUtil.nanosToMillis(timeUnits); Review Comment: @epgif, why does the addition of nanosecond precision require switching `now` throughout this file from microseconds to nanoseconds? It seems to me that this could remain as it was. -- 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