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

   #### Summary
   
   This commit introduces statement-level code generation for Flink CDC YAML 
Transform expressions. Transform expressions are now represented by a 
`GeneratedExpression` intermediate structure and compiled through Janino 
`ScriptEvaluator`, allowing nullable `AND` / `OR` short-circuit logic to be 
generated as explicit `if` / `else` statements instead of per-record `Supplier` 
wrappers.
   
   #### Key Changes
   
   1. Introduce Statement-Level Transform Codegen
   - Added `GeneratedExpression` to carry generated statements, result term, 
and result Java type.
   - Added `TransformExpressionEvaluator` as a small wrapper around Janino 
`ScriptEvaluator`.
   - Updated projection and filter processors to compile and evaluate generated 
scripts.
   
   2. Support Statement-Level Nullable AND / OR
   - Added `translateSqlNodeToGeneratedExpression(...)` in `JaninoCompiler`.
   - Generates explicit short-circuit `if` / `else` blocks for nullable `AND` 
and `OR`.
   - Ensures the right operand is evaluated only when required.
   
   3. Refine Nullability Handling
   - Added Calcite / RelNode nullability lookup for transform sub-expressions.
   - Uses RelNode nullability only to refine the existing conservative 
fallback, avoiding broader semantic changes in this PR.
   
   4. Test Coverage
   - Added coverage for nullable `AND` / `OR` SQL three-valued logic.
   - Added short-circuit tests for:
     - `false AND (1 / 0 > 0)`
     - `true OR (1 / 0 > 0)`
   - Added projection and filter coverage.
   - Added assertions that generated code no longer contains `new Supplier`.
   
   #### JIRA Reference
   
   [https://issues.apache.org/jira/browse/FLINK-40204](url)


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