Skip to content

fix: handle zero-length null extension for empty unions - #11209

Merged
Jefffrey merged 4 commits into
apache:mainfrom
efegokdemir:codex/issue-11198-empty-union-null-extension
Oct 18, 2026
Merged

Jefffrey merged 4 commits into
apache:mainfrom
efegokdemir:codex/issue-11198-empty-union-null-extension

Conversation

@efegokdemir

@efegokdemir efegokdemir commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

MutableArrayData::try_extend_nulls(0) remains a no-op for empty unions. For non-empty sparse and dense unions, null extension now uses a nullable child field rather than assuming the first child is nullable.

Fixes #11198

Testing

  • cargo test --locked --manifest-path arrow-data/Cargo.toml -p arrow-data --lib (64 passed)
  • cargo fmt --all -- --check
  • git diff --check HEAD^ HEAD

AI assistance was used during implementation.

@github-actions github-actions Bot added arrow Changes to the arrow crate arrow-data labels Sep 25, 2026
@Jefffrey

Copy link
Copy Markdown
Contributor

closing as i suspect its AI spam and doesnt fully address the root cause issue

@alamb

alamb commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Per discussion on #11215, reopening this PR and marking it draft while @efegokdemir works through the feedback

@alamb
alamb marked this pull request as draft September 25, 2026 14:19
@efegokdemir
efegokdemir force-pushed the codex/issue-11198-empty-union-null-extension branch from efd6eb4 to fa9d211 Compare September 27, 2026 19:18
@efegokdemir

Copy link
Copy Markdown
Contributor Author

Addressed the non-zero case in fa9d2110. Empty unions now return InvalidArgumentError before mutating state when a positive null extension is requested; zero-length extensions remain no-ops for both sparse and dense unions. The regression test covers both modes and verifies the length remains unchanged after the error.

Validation: /opt/homebrew/bin/rustfmt --check arrow-data/src/transform/mod.rs arrow-data/src/transform/union.rs, git diff --check, and cargo test --locked --manifest-path arrow-data/Cargo.toml -p arrow-data --lib test_try_extend_nulls_empty_union all passed.

@Jefffrey
Jefffrey marked this pull request as ready for review September 30, 2026 14:08
Comment thread arrow-data/src/transform/mod.rs Resolved
Comment thread arrow-data/src/transform/union.rs Resolved
Comment thread arrow-data/src/transform/mod.rs Resolved
@github-actions github-actions Bot added the arrow-core Core crates related to representing arrow data label Oct 14, 2026
@Jefffrey Jefffrey added the bug label Oct 18, 2026
@Jefffrey
Jefffrey enabled auto-merge October 18, 2026 02:44
@Jefffrey
Jefffrey added this pull request to the merge queue Oct 18, 2026
Merged via the queue into apache:main with commit f53b221 Oct 18, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate arrow-core Core crates related to representing arrow data arrow-data bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MutableArrayData::try_extend_nulls panics on empty union input

3 participants