[FLINK-40151][runtime] Support missing YAML Transform predicates and nullable BOOLEAN logical evaluation#4474
[FLINK-40151][runtime] Support missing YAML Transform predicates and nullable BOOLEAN logical evaluation#4474haruki-830 wants to merge 4 commits into
Conversation
|
@lvyanquan Could u PTAL when u have time? Thanks! |
|
Thanks for the work here. The changes split into three buckets with very different compatibility impact. I'd suggest applying buckets 1–2 unconditionally and gating bucket 3 behind an explicit option. 1. New operators (currently unparseable) — keep always-on SQL: These fail validation on the current release, so no existing pipeline can depend on them. Safe to enable unconditionally. 2. Crash → 3-valued logic, non-NULL behavior unchanged — keep always-on SQL: These previously threw an NPE on NULL; results for non-NULL operands are identical. Pure crash fix, safe to enable unconditionally. 3. Silent result changes — must be gated behind an explicit option SQL:
This is a backward-incompatible change to user-facing semantics, and the silent nature makes it dangerous: after the upgrade the YAML is unchanged, the job stays healthy, and no error or warning is emitted, yet the output data changes. For a CDC sync, altered filter results change which Recommendation Introduce Also, to ease review, consider splitting this so buckets 1–2 and bucket 3 land as separate commits (or separate PRs) — the crash/parse fixes can then be merged quickly, while the semantic change is reviewed on its own. |
Thanks for the detailed review and the compatibility analysis. I agree with the split. I will separate this work into two PRs:
This should allow the parse/crash fixes to move forward independently, while keeping the silent result-changing semantics isolated and explicitly gated. |
…nullable BOOLEAN logical evaluation
| throw new ParseException("Unrecognized expression: " + sqlBasicCall.toString()); | ||
| } | ||
| Java.Rvalue rightOperandSupplier = | ||
| new Java.AmbiguousName(Location.NOWHERE, new String[] {"() -> " + atoms[1]}); |
There was a problem hiding this comment.
Could we add an end-to-end compilation test to JaninoCompilerTest?
The existing tests only verify the generated expression string or invoke
LogicalFunctions directly. They do not compile the generated expression with
Janino, so they cannot detect that Janino 3.1.10 does not support lambda
expressions.
There was a problem hiding this comment.
Addressed in the latest commit.
|
Please update both the English and Chinese transform documentation to reflect these changes |
|
Also cc’ing @yuxiqian. |
Summary
This commit improves YAML Transform predicate support and nullable BOOLEAN logical evaluation. It adds support for several previously unsupported SQL predicates, and fixes runtime failures when logical expressions evaluate nullable BOOLEAN operands.
Key Changes
Additional Predicate Support
IS UNKNOWN/IS NOT UNKNOWN.IS DISTINCT FROM/IS NOT DISTINCT FROM.LIKE ... ESCAPE.SIMILAR TO/NOT SIMILAR TO.Nullable BOOLEAN Logical Evaluation
AND,OR, andNOTwith nullable BOOLEAN operands.IS TRUE/IS NOT TRUE.IS FALSE/IS NOT FALSE.UNKNOWNdoes not cause Java unboxing failures.Test Coverage
LIKE,LIKE ... ESCAPE, andSIMILAR TO.JIRA Reference
https://issues.apache.org/jira/browse/FLINK-40151