Skip to content

fix: propagate nested cast errors#4675

Open
manuzhang wants to merge 2 commits into
apache:mainfrom
manuzhang:codex/propagate-nested-cast-errors
Open

fix: propagate nested cast errors#4675
manuzhang wants to merge 2 commits into
apache:mainfrom
manuzhang:codex/propagate-nested-cast-errors

Conversation

@manuzhang

@manuzhang manuzhang commented Jun 18, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Part of #4248

Rationale for this change

Nested struct casts currently unwrap nested cast results while building the output StructArray. When a nested cast fails, such as an ANSI overflow inside a struct, that unwrap can panic instead of returning the cast failure as a normal DataFusion error.

What changes are included in this PR?

  • Propagate nested struct cast errors through DataFusionResult instead of unwrapping.
  • Add coverage for nested struct-to-string casts, nested struct-to-struct casts, array cast ANSI overflow, and expected ANSI failures in the cast helper.

How are these changes tested?

Updated tests suites and added native UTs.


Co-authored-by: @codex

Return nested struct cast failures through DataFusion errors instead of unwrapping arrays during struct-to-struct casts. Add coverage for nested struct, array, and ANSI overflow cases.

Co-authored-by: Codex <codex@openai.com>
@manuzhang manuzhang force-pushed the codex/propagate-nested-cast-errors branch from e2f89dd to 9e8d1ca Compare June 18, 2026 15:40

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @manuzhang can we add a sql test as well?

Co-authored-by: Codex <codex@openai.com>
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.

2 participants