datafusion-contrib / datafusion-contrib/StreamFusion
Native CAST: support BOOLEAN to STRING/VARCHAR
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.
BOOLEAN-to-character casts still force Calc fallback.
Use a runtime source src(b BOOLEAN) with TRUE, FALSE and NULL, and execute:
SELECT CAST(b AS STRING) FROM src;
Independently verified runtime probes return 'TRUE', 'FALSE', and NULL in both engines, but native admission reports Calc: unsupported CAST BOOLEAN->VARCHAR (the planner renders the arrow as U+2192). Zero native substitutions are recorded.
Preserve uppercase Flink formatting, NULLs and declared character-length semantics. Test STRING/VARCHAR and explicitly establish bounded CHAR/VARCHAR behavior instead of assuming the unbounded implementation covers truncation/padding.
This is the opposite direction from the STRING-to-BOOLEAN support shipped for #86.
Suggested priority: P2, a small basic-type gap that can block larger projections.
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 3 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the native CAST admission path and the existing STRING-to-BOOLEAN support from #86. Add runtime-source SQL parity tests for BOOLEAN to STRING/VARCHAR, covering values, resolved types, NULLs, boundary and error cases, then update docs/operators/calc-filter.md with the admitted scope and verify safe fallback for unverified forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100