rdblue commented on a change in pull request #357: Add in and not in predicates
URL: https://github.com/apache/incubator-iceberg/pull/357#discussion_r313498614
##########
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:
> UnboundPredicate for IN predicate with a single item should return an EQ
predicate. The separation will complicate it.
I disagree because that over-complicates the predicate classes. The factory
methods in `Expressions` are allowed to change the predicate that is returned;
for example, `and(true, p)` returns just `p`. That's what we should use to
return an equality predicate. The predicate class itself should not include
logic for changing itself.
----------------------------------------------------------------
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]