moulimukherjee commented on a change in pull request #283: Add projectStrict 
for Dates and Timestamps
URL: https://github.com/apache/incubator-iceberg/pull/283#discussion_r306983786
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/transforms/ProjectionUtil.java
 ##########
 @@ -52,6 +52,84 @@ private ProjectionUtil() {}
     }
   }
 
+  static <T> UnboundPredicate<T> truncateIntegerStrict(
+      String name, BoundPredicate<Integer> pred, Transform<Integer, T> 
transform) {
+    int boundary = pred.literal().value();
+    switch (pred.op()) {
+      case LT:
+        // Checking if the literal is at the lower partition boundary
+        if (transform.apply(boundary - 1).equals(transform.apply(boundary))) {
+          return predicate(Expression.Operation.LT, name, 
transform.apply(boundary - 1));
 
 Review comment:
   Ack, will add comments and examples. 
   
   I had originally started with keeping the operation same to `LT_EQ`, but 
then that makes it specific to only Integer values. The same logic might be 
applicable to the truncate ones too? So did not want to tie it to a type. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to