rdblue commented on code in PR #9008:
URL: https://github.com/apache/iceberg/pull/9008#discussion_r1421811669


##########
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:
   I don't understand why there are so many changes here. Couldn't this leave 
`now` in micros and just convert nanos to micros here?



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

Reply via email to