Skip to content

feat(datafusion): support binary casts and byte widths - #1288

Merged
JingsongLi merged 2 commits into
apache:mainfrom
JingsongLi:codex/fusion-binary-casts
Nov 2, 2026
Merged

JingsongLi merged 2 commits into
apache:mainfrom
JingsongLi:codex/fusion-binary-casts

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Closes #1282.

DataFusion's default SQL type planner rejects BINARY and VARBINARY query casts. SQLContext can declare these Paimon column types but cannot use the corresponding casts.

Brief change log

  • Map binary SQL types to Arrow Binary through the native type-planner extension.
  • Apply declared byte widths: truncate bounded casts, zero-pad BINARY(n), and preserve native CAST/TRY_CAST conversion and NULL behavior.
  • Apply lowering consistently to expressions and stored-query planning while preserving portable REST view/function definitions.

Tests

API and Format

Adds SQLContext SQL capabilities. No storage-format or Rust public API changes.

Documentation

Documented syntax, type/null/error behavior and supported limits in docs/src/sql.md.

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JingsongLi
JingsongLi merged commit 4bece77 into apache:main Nov 2, 2026
15 checks passed
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.

[datafusion] Support binary CAST types and byte-width semantics

2 participants