wgtmac commented on code in PR #1328:
URL: https://github.com/apache/parquet-mr/pull/1328#discussion_r1582198726


##########
parquet-column/src/main/java/org/apache/parquet/filter2/predicate/FilterApi.java:
##########
@@ -257,6 +266,16 @@ public static <T extends Comparable<T>, C extends 
Column<T> & SupportsEqNotEq> N
     return new NotIn<>(column, values);
   }
 
+  public static <T extends Comparable<T>, C extends Column<T> & 
SupportsContains> Contains<T> contains(

Review Comment:
   > Ok, I've pushed my changes to support composable contains predicates! 
example usage:
   > 
   > ```java
   > FilterApi.containsOr(
   >   FilterApi.containsEq(longColumn("phoneNumbers.phone.number"), 
5555555555L),
   >   FilterApi.containsOr(
   >     FilterApi.containsEq(longColumn("phoneNumbers.phone.number"), 
-10000000L),
   >     FilterApi.containsEq(longColumn("phoneNumbers.phone.number"), 
2222222222L)));
   > ```
   > 
   > I left out implementing DoesNotContain/ContainsNotEq for now to keep the 
PR simpler to parse. Let me know if the API looks ok 👍 Then I can fill out the 
rest of the implementations/make the unit tests more thorough.
   
   Sorry I didn't make it clear. I thought we could still leverage [existing 
composite 
expression](https://github.com/apache/parquet-mr/blob/master/parquet-column/src/main/java/org/apache/parquet/filter2/predicate/FilterApi.java#L293-L326)
 and combine `CONTAINS(x)` sub-expressions under the same level of `AND` or 
`OR` expression during rewrite process like 
https://github.com/apache/parquet-mr/blob/master/parquet-column/src/main/java/org/apache/parquet/filter2/compat/FilterCompat.java#L79.
 It would be harder to maintain the code if introduce new specialized composite 
expression like `containsOr`.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to