Skip to content

CI: reconcile function fallback assertions with admission in #220 #223

Description

@liuyongvs

PR #220 admits scalar overloads that older tests still require to fall back. This makes both Java CI jobs fail on routing assertions, and one ELT test fails on an outdated fallback-reason assertion. Track the test-contract updates here; the function implementation work is already tracked by the linked issues.

Evidence

Observed on PR #220 head cf27931e, based on main 89da01cd, in CI run 35580118438:

  • Flink 1.18 Java job: 3546 tests, 11 failures, 0 errors.
  • Flink 2.2 Java job: 3561 tests, 16 failures, 0 errors.
  • Typical assertion: query unexpectedly routed to native ==> expected: <0> but was: <1>.
  • BOOLEAN IF: the encoder now returns an expression where the old test expects null.
  • Fixed-length binary ELT still falls back, but its reason is now Calc: unsupported generated-expression result type BINARY(1) instead of a reason containing ELT.

These logs show admission/reason assertion failures, not demonstrated wrong results. NativeParity.assertFallbackReasonContains checks the substitution count before comparing collected host/native rows; a failed routing assertion prevents the equality assertion from running. Updating routing expectations must therefore be accompanied by actual result/type/NULL/error parity checks.

Function checklist

Function / overload Example from the failed fixture Existing support issue Follow-up
Integral ABS in projections and filters ABS(v), WHERE ABS(v) > 20 #208 Replace old rejection expectations with verified native parity; retain a separate valid fallback fixture.
Runtime STRING GREATEST / LEAST GREATEST(s, <supplementary-character literal>), LEAST(s, <same literal>) #209 Assert admitted Java-backed input behavior and UTF-16 ordering; retain coverage for source representations that remain unsupported.
BOOLEAN-result IF IF(condition, boolean_value, boolean_value) #210 Separate the admitted BOOLEAN case from the still-unverified result types in the rejection test.
PARSE_URL PARSE_URL(s, 'HOST'), PARSE_URL(u, 'HOST') #214 Update the Calc fixture and the PARSE_URL case located in the URL_DECODE test class.
Dynamic LTRIM / RTRIM / BTRIM LTRIM(s,p), RTRIM(s,p), BTRIM(s,p) #216 Verify supported dynamic sets and keep the remaining source-representation gates explicit.
Dynamic SHA2; FROM_BASE64 SHA2(s,bits); FROM_BASE64(CASE WHEN s IS NULL THEN CAST(NULL AS STRING) ELSE 'YQ==' END) #217 Update routing expectations and verify varying widths, NULL/error behavior, and decoded output bytes. The Base64 failure is FROM_BASE64, although the class is named FlinkToBase64SqlHarnessTest.
Binary STARTSWITH / ENDSWITH; fixed BINARY ELT reason STARTSWITH(binary_value,X'FF'), ENDSWITH(binary_value,X'FF'), ELT(i,X'AB',X'CD') #218 Verify admitted binary predicates. Keep fixed-length BINARY distinct from BYTES/VARBINARY and assert its actual retained result-type fallback.

Exact failed tests

The following 11 fail on both release lines:

  • FlinkCalcSqlHarnessTest.absIntegerFallsBack
  • FlinkCalcSqlHarnessTest.unsupportedProjectionFunctionFallsBack (PARSE_URL)
  • FlinkFilterSqlHarnessTest.unsupportedFunctionFallsBack (ABS)
  • FlinkGreatestSqlHarnessTest.unrestrictedUnicodeStringsFallBack
  • FlinkLeastSqlHarnessTest.unrestrictedUnicodeStringsFallBack
  • FlinkLtrimSqlHarnessTest.dynamicTrimSetsFallBack
  • FlinkRtrimSqlHarnessTest.dynamicTrimSetsFallBack
  • FlinkStringHashSqlHarnessTest.dynamicSha2BitLengthFallsBack
  • FlinkToBase64SqlHarnessTest.unverifiedOverloadsFallBack (FROM_BASE64)
  • IfAdmissionTest.unregisteredHostOverloadsStayOutsideNativeCaseLowering (BOOLEAN)
  • NativePlannerTest.leavesUnsupportedProjectionToHostEngine (ABS)

Five additional failures appear in the Flink 2.2 job:

  • FlinkBtrimSqlHarnessTest.dynamicTrimSetsFallBack
  • FlinkEndsWithSqlHarnessTest.unverifiedOverloadsFallBack
  • FlinkStartsWithSqlHarnessTest.unverifiedOverloadsFallBack
  • FlinkUrlDecodeSqlHarnessTest.unverifiedOverloadsFallBack (PARSE_URL)
  • FlinkEltSqlHarnessTest.unverifiedOverloadsFallBack (second assertion, fixed-length BINARY result)

Related ABS fallout: PaimonSourceSharingTest uses ABS as a fallback branch, so it expects NativeShare(consumers=[2]) while the admitted ABS branch makes the plan share three consumers. Update that fixture's intended native/fallback contract and verify sink results as part of the same CI cleanup.

Acceptance

  • Reconcile the tests with the supported overloads and input representations in Extend native Calc function coverage with released Flink semantics #220. Rename stale test names/comments and preserve independent coverage of real fallback paths.
  • For newly admitted cases, assert native execution and compare values, resolved result types, NULLs, and relevant error/short-circuit behavior with released Flink. Do not only remove the failing assertions.
  • Keep the fixed-length BINARY ELT result restriction and oversized BIGINT ELT index restriction covered unless separately implemented and verified.
  • Run the affected suites on Flink 2.2 and 1.18; mark host-unavailable functions explicitly rather than treating skips as parity proof. Verify the ABS-dependent Paimon source-sharing tests as well.
  • Keep docs/operators/calc-filter.md aligned if the work changes an admission boundary.

Suggested priority: P2; complete the basic numeric, STRING and BOOLEAN checks before optional binary-overload expansion. This issue records CI/test-contract follow-up only and does not claim any new implementation or parity rerun.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions