rdblue commented on a change in pull request #357: Jun/in and not in predicates
URL: https://github.com/apache/incubator-iceberg/pull/357#discussion_r311680177
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/expressions/Evaluator.java
 ##########
 @@ -134,13 +135,13 @@ public Boolean or(Boolean leftResult, Boolean 
rightResult) {
     }
 
     @Override
-    public <T> Boolean in(BoundReference<T> ref, Literal<T> lit) {
-      throw new UnsupportedOperationException("In is not supported yet");
+    public <T> Boolean in(BoundReference<T> ref, Set<Literal<T>> lits) {
+      return lits.contains(Literals.from(ref.get(struct)));
 
 Review comment:
   I think it is a problem that this calls `Literals.from` for every 
comparison. That inspects the value and builds a literal for it in a series of 
`if` statements. It should be avoided in a tight loop.

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