jun-he commented on a change in pull request #357: Add in and not in predicates
URL: https://github.com/apache/incubator-iceberg/pull/357#discussion_r313593900
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/expressions/Predicate.java
 ##########
 @@ -19,15 +19,44 @@
 
 package org.apache.iceberg.expressions;
 
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableSet;
+import java.util.Collection;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
 public abstract class Predicate<T, R extends Reference> implements Expression {
   private final Operation op;
   private final R ref;
   private final Literal<T> literal;
+  private final Set<Literal<T>> literalSet;
 
 Review comment:
   @rdblue Sorry for the confusion.
   
   In this change, only factory methods in `Expressions` and the `bind` in 
`UnboundPredicate` can change the returned predicate.
   
   What I meant is that the factory method `in` will return an `EQ` predicate 
if only a single element is provided because UnboundPredicate factory method 
for IN operation with a single item should return `EQ` predicate.
   
   As the `bind` returns `Expression`, it is straightforward to separated the 
`BoundPredicate`.
   
   But in the case of the factory method, if it also returns `Expression` or a 
new interface class instead of `UnboundPredicate`, then later when it is used, 
it has to be explicitly cast by checking the `operation`. This seems 
over-complicated compared to the current approach.
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to