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_r312720963
 
 

 ##########
 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:
   Thanks for the comment! 
   Taking a quick look at the literal's `comparator`s and seems all of them are 
consistent with `equals` of the underlying values. 
   So it seems to be safe to just put the values into the `Set` instead of 
putting literals.
   I will make a change to avoid the unnecessary literal cast.

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