Rechecked on 2026-09-20 against canonical main 89da01cdad7342c4d825e36eaf4e8dc73bc7af9f, released Apache Flink 2.2.1, JDK 17, default compatibility settings. Each expression was run against independent stock-Flink and StreamFusion-enabled streaming environments with bounded runtime DataStream input (parallelism 1), so source values cannot be folded away. Results and resolved result types agree through Flink fallback; this is a native support gap, not a demonstrated wrong-result bug.
Basic exact numeric expressions still reject native Calc. Reproduced using adapted SQL cases from Flink's ScalarFunctionsTest / DecimalTypeTest and minimal runtime probes.
For runtime columns i INT=-3, n BIGINT=-4, d DECIMAL(20,3)=-12.345, execute each projection separately:
| Expression |
Flink result |
Fallback reason |
ABS(i), ABS(n), ABS(d) |
3, 4, 12.345 |
ABS: only float/double operands admitted |
SIGN(i), SIGN(n), SIGN(d) |
-1, -1, -1.000 |
SIGN: only float/double operands admitted |
FLOOR(i), FLOOR(n) |
-3, -4 |
FLOOR: only float/double operands admitted |
CEIL(i), CEIL(n) |
-3, -4 |
CEIL: only float/double operands admitted |
TRUNCATE(i), TRUNCATE(n,-1) |
-3, 0 |
TRUNCATE requires a DECIMAL operand |
Example: SELECT ABS(d) FROM src.
Separately, SELECT -d FROM src with d DECIMAL(7,2)=123.45 returns -123.45 via Calc: -: only float/double operands admitted. This gate also blocks composed MOD/ROUND expressions.
Preserve Flink's exact types and overflow behavior: runtime ABS(INT_MIN) returns INT_MIN and ABS(BIGINT_MIN) returns BIGINT_MIN. DECIMAL TRUNCATE already runs natively (#149); this ticket's TRUNCATE work is integral.
DECIMAL FLOOR/CEIL are excluded from the confirmed successful cases: both baseline and native-enabled jobs hit an AbstractBinaryWriter.writeDecimal assertion in this audit's collect sink. Investigate that released-host contract separately before expanding their admission.
Suggested priority: P2, first within the basic-type support backlog.
Acceptance: add runtime-source SQL parity tests that assert native Calc execution as well as values and resolved types; include NULLs and boundary/error cases; retain safe fallback for unverified forms and update docs/operators/calc-filter.md with the admitted scope.
Latest-main validation: rebuilt the debug native library from this commit and ran 562 targeted runtime SQL cases covering these support gaps and adjacent controls. This issue group contains 47 successful comparisons that still record explicit fallback. Host-rejected/both-error cases are excluded from that count. This validates released Flink 2.2.1; it does not claim execution of the Flink 1.18 profile. No implementation is included.
Distinct from closed #62 (binary DECIMAL arithmetic overflow correctness): these expressions currently execute through a planner fallback.
Rechecked on 2026-09-20 against canonical main
89da01cdad7342c4d825e36eaf4e8dc73bc7af9f, released Apache Flink 2.2.1, JDK 17, default compatibility settings. Each expression was run against independent stock-Flink and StreamFusion-enabled streaming environments with bounded runtime DataStream input (parallelism 1), so source values cannot be folded away. Results and resolved result types agree through Flink fallback; this is a native support gap, not a demonstrated wrong-result bug.Basic exact numeric expressions still reject native Calc. Reproduced using adapted SQL cases from Flink's
ScalarFunctionsTest/DecimalTypeTestand minimal runtime probes.For runtime columns
i INT=-3, n BIGINT=-4, d DECIMAL(20,3)=-12.345, execute each projection separately:ABS(i),ABS(n),ABS(d)SIGN(i),SIGN(n),SIGN(d)FLOOR(i),FLOOR(n)CEIL(i),CEIL(n)TRUNCATE(i),TRUNCATE(n,-1)Example:
SELECT ABS(d) FROM src.Separately,
SELECT -d FROM srcwithd DECIMAL(7,2)=123.45returns -123.45 viaCalc: -: only float/double operands admitted. This gate also blocks composed MOD/ROUND expressions.Preserve Flink's exact types and overflow behavior: runtime ABS(INT_MIN) returns INT_MIN and ABS(BIGINT_MIN) returns BIGINT_MIN. DECIMAL TRUNCATE already runs natively (#149); this ticket's TRUNCATE work is integral.
DECIMAL FLOOR/CEIL are excluded from the confirmed successful cases: both baseline and native-enabled jobs hit an AbstractBinaryWriter.writeDecimal assertion in this audit's collect sink. Investigate that released-host contract separately before expanding their admission.
Suggested priority: P2, first within the basic-type support backlog.
Acceptance: add runtime-source SQL parity tests that assert native Calc execution as well as values and resolved types; include NULLs and boundary/error cases; retain safe fallback for unverified forms and update
docs/operators/calc-filter.mdwith the admitted scope.Latest-main validation: rebuilt the debug native library from this commit and ran 562 targeted runtime SQL cases covering these support gaps and adjacent controls. This issue group contains 47 successful comparisons that still record explicit fallback. Host-rejected/both-error cases are excluded from that count. This validates released Flink 2.2.1; it does not claim execution of the Flink 1.18 profile. No implementation is included.
Distinct from closed #62 (binary DECIMAL arithmetic overflow correctness): these expressions currently execute through a planner fallback.