You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/10/17 03:22:39 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #5944: API: Update expression sanitization for relative dates and times

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


##########
api/src/main/java/org/apache/iceberg/expressions/ExpressionUtil.java:
##########
@@ -111,7 +122,15 @@ public static boolean selectsPartitions(
 
   private static class ExpressionSanitizer
       extends ExpressionVisitors.ExpressionVisitor<Expression> {
-    private static final ExpressionSanitizer INSTANCE = new ExpressionSanitizer();
+    private final long now;
+    private final int today;
+
+    private ExpressionSanitizer() {
+      long nowMillis = System.currentTimeMillis();
+      OffsetDateTime nowDateTime = Instant.ofEpochMilli(nowMillis).atOffset(ZoneOffset.UTC);
+      this.now = nowMillis * 1000;

Review Comment:
   Done.



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org