haruki-830 opened a new pull request, #4499:
URL: https://github.com/apache/flink-cdc/pull/4499

   #### Summary
   
   This commit preserves operator precedence when generating Janino expressions 
for Flink CDC pipeline transforms. Nested binary expressions now retain the 
parentheses required to preserve their original semantics.
   
   #### Key Changes
   
   1. Binary Operator Precedence Handling
   - Added precedence definitions for logical and arithmetic binary operators.
   - Wraps lower-precedence child expressions with `ParenthesizedExpression`.
   - Preserves same-precedence right-hand grouping for expressions such as `a / 
(b * c)` and `a - (b - c)`.
   - Avoids unnecessary parentheses when the existing precedence already 
preserves evaluation order.
   
   2. Correct Nested Expression Generation
   - Correctly generates expressions such as `(a + b) * c` and `(a OR b) AND c`.
   - Fixes existing transform expressions such as `weight / (height * height)` 
that previously changed semantics after code generation.
   
   3. Test Coverage
   - Added coverage for nested arithmetic and logical expression generation.
   - Added runtime evaluation tests to verify that generated Janino expressions 
preserve the expected results.
   - Covered expressions that do not require additional parentheses to prevent 
redundant wrapping.
   
   #### JIRA Reference
   
   
[https://issues.apache.org/jira/browse/FLINK-40337](https://issues.apache.org/jira/browse/FLINK-40337)


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