Skip to content

feat(array): cast bool and primitive values to Utf8 - #9261

Open
haohuaijin wants to merge 4 commits into
vortex-data:developfrom
haohuaijin:codex/bool-primitive-to-utf8
Open

feat(array): cast bool and primitive values to Utf8#9261
haohuaijin wants to merge 4 commits into
vortex-data:developfrom
haohuaijin:codex/bool-primitive-to-utf8

Conversation

@haohuaijin

@haohuaijin haohuaijin commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

DataFusion can push CAST(... AS STRING) into Vortex scans, but boolean and primitive arrays currently lack native casts to Utf8, causing pushed queries to fail with a missing CastKernel.

Related to #6211, #8621, and #6702.

What changes are included in this PR?

  • Add BoolArray -> Utf8 and PrimitiveArray -> Utf8 casts.
  • Add corresponding scalar casts, including Bool -> Primitive.
  • Preserve nullability and use Arrow-compatible numeric formatting.
  • Add unit tests and a DataFusion projection-pushdown E2E test.

Validation:

  • cargo nextest run -p vortex-array
  • cargo nextest run -p vortex-datafusion
    • Includes an E2E test that writes nullable Boolean, Int64, and Float64 columns to a Vortex file, runs CAST(... AS STRING) with projection pushdown enabled, and verifies both values and nulls.
    • The E2E test fails on develop with a missing Bool -> Utf8 cast kernel and passes with this PR.
  • cargo clippy -p vortex-datafusion --all-targets --all-features
  • cargo +nightly fmt --all

What APIs are changed? Are there any user-facing changes?

No public API signatures are changed.

Boolean and primitive values can now be cast to Utf8 inside Vortex, including DataFusion projection pushdown.

@haohuaijin
haohuaijin force-pushed the codex/bool-primitive-to-utf8 branch from 36c6f4f to ff0d6f9 Compare August 7, 2026 06:19
@haohuaijin
haohuaijin marked this pull request as ready for review August 7, 2026 07:39
Signed-off-by: Huaijin <haohuaijin@gmail.com>
…r path

Signed-off-by: Huaijin <haohuaijin@gmail.com>
Signed-off-by: Huaijin <haohuaijin@gmail.com>
Drop the TestResult alias and inline crate::Canonical qualifications in the
primitive cast tests, move to_bit_buffer out of the all-null bool cast path,
and cover f16 NaN/inf formatting in the array-path utf8 cast.

Signed-off-by: Huaijin <haohuaijin@gmail.com>
@haohuaijin
haohuaijin force-pushed the codex/bool-primitive-to-utf8 branch from db1e564 to d12b54a Compare August 8, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant