yzeng1618 commented on code in PR #10977:
URL: https://github.com/apache/seatunnel/pull/10977#discussion_r3353023566


##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigValidator.java:
##########
@@ -327,18 +450,33 @@ private boolean validate(Expression expression) {
         }
     }
 
+    /**
+     * Evaluates a condition chain with standard boolean precedence: AND binds 
tighter than OR. The
+     * chain {@code A.and(B).or(C)} evaluates as {@code (A && B) || C}, 
matching the output of
+     * {@link Condition#toString()}.
+     */
     private <T> boolean validate(Condition<T> condition) {

Review Comment:
   ConfigValidator: validate(Expression) and validate(Condition) use different 
boolean precedence
   I noticed the two evaluation paths handle precedence differently:
   
   validate(Condition) splits the chain into OR-separated AND segments, i.e. 
A.and(B).or(C) → (A && B) || C. This matches Condition#toString() and the 
documented rule "AND binds tighter than OR".
   
   validate(Expression) evaluates Expression nodes strictly left-to-right with 
short-circuit, so when nodes are combined as A.and(B).or(C) across Expression 
boundaries it effectively becomes A && (B || C).



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