linliu-code commented on code in PR #13300:
URL: https://github.com/apache/hudi/pull/13300#discussion_r2093396408
##########
hudi-common/src/main/java/org/apache/hudi/expression/Predicates.java:
##########
@@ -406,4 +406,40 @@ public Boolean eval(StructLike data) {
}
}
}
+
+ public static class StringStartsWithAny implements Predicate {
+ private final Operator operator;
+ private final Expression left;
+ private final List<Expression> right;
+
+ public StringStartsWithAny(Expression left, List<Expression> right) {
+ this.left = left;
+ this.operator = Operator.STARTS_WITH;
+ this.right = right;
+ }
+
+ @Override
+ public List<Expression> getChildren() {
+ List<Expression> children = new ArrayList<>();
+ children.add(left);
+ children.addAll(right);
+ return children;
+ }
+
+ @Override
+ public Operator getOperator() {
+ return operator;
+ }
+
+ @Override
+ public Object eval(StructLike data) {
+ for (Expression e : right) {
+ Expression exp = new StringStartsWith(left, e);
Review Comment:
Yeah for every record. We can do some performance test to see how much
regression we have, since check for all prefixes are expensive already and
necessary.
--
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]