datafusion-contrib / datafusion-contrib/StreamFusion

Native binary overloads: support STARTSWITH, ENDSWITH and ELT

Open
#218 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
120
Forks
8
Avg merge
7h 29m
Merged PRs (30d)
76

Description

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.

The character overloads do not cover BYTES arguments. Adapted StringFunctionsITCase SQL and minimal runtime probes confirm these remaining binary forms.

Runtime columns v BYTES=X'01020304', p BYTES=X'0102', q BYTES=X'0304':

SELECT STARTSWITH(v,p) FROM src; -- TRUE
SELECT ENDSWITH(v,q) FROM src;   -- TRUE
SELECT ELT(2,p,q) FROM src;      -- X'0304'

Recorded reasons:

  • Calc: STARTSWITH requires 2..2 character arguments
  • Calc: ENDSWITH requires 2..2 character arguments
  • Calc: ELT requires an INTEGER index and character values

The BOOLEAN/BOOLEAN/BYTES outputs match released Flink through fallback with zero native substitutions. Cover arbitrary byte values including zero/high-bit bytes, empty values, NULLs, index bounds and sliced buffers; do not decode binary operands as text.

Suggested priority: P3, after STRING, exact numeric and temporal scalar coverage.

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

Related: PR #44 documented narrower admitted overloads and the remaining fallback; this ticket tracks the unimplemented forms.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the adapted StringFunctionsITCase SQL and the existing native Calc/fallback handling. Add runtime-source parity coverage for STARTSWITH, ENDSWITH, and ELT over BYTES, including NULLs, boundaries, errors, values, and resolved types, then verify native execution and update docs/operators/calc-filter.md with the admitted scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
documentation, stream-processing, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.