voonhous commented on code in PR #19241:
URL: https://github.com/apache/hudi/pull/19241#discussion_r3557280097


##########
hudi-common/src/main/java/org/apache/hudi/common/expression/Predicates.java:
##########
@@ -486,6 +486,13 @@ public Object eval(StructLike data) {
       return false;
     }
 
+    @Override
+    public String toString() {
+      // The left expression is absent for the metadata table key filters, so 
it must not be dereferenced.

Review Comment:
   The comment covers `left`, but `right.stream().map(Expression::toString)` 
would also NPE on a null element. Not reachable today (same as `In.toString()`) 
-- just flagging that the guarantee is left-only.



##########
hudi-common/src/main/java/org/apache/hudi/common/expression/Predicates.java:
##########
@@ -486,6 +486,13 @@ public Object eval(StructLike data) {
       return false;
     }
 
+    @Override
+    public String toString() {
+      // The left expression is absent for the metadata table key filters, so 
it must not be dereferenced.
+      return left + ".startsWithAny("
+          + 
right.stream().map(Expression::toString).collect(Collectors.joining(",", "(", 
")")) + ")";

Review Comment:
   Nit: this renders `key.startsWithAny((k1,k2))` -- doubled parens (the 
method's own `(` plus the `(`/`)` args passed to `joining`). Matches 
`In.toString()` so fine to keep; `joining(",")` would give single parens if 
you'd rather have `startsWithAny(k1,k2)`.



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

Reply via email to