Skip to content

BUGV2-5495: Fix RowConverter panic with DictionaryArray in Struct/List - #77

Merged
dispanser merged 2 commits into
v55from
tp/fix-row-converter-for-dictionary
Mar 27, 2026
Merged

BUGV2-5495: Fix RowConverter panic with DictionaryArray in Struct/List#77
dispanser merged 2 commits into
v55from
tp/fix-row-converter-for-dictionary

Conversation

@dispanser

Copy link
Copy Markdown

Cherry-picked from upstream arrow-rs 56.1.0 (PR apache#7627, issue apache#7165). Drop this commit when upgrading arrow-rs to >= 56.1.0.

Original: Fix RowConverter panic when encoding DictionaryArrays in StructArray / ListArray. The RowConverter flattens Dictionary types during encoding but didn't account for this when decoding, causing List<Dictionary<K,V>> and Struct containing Dictionary fields to panic in GenericListArray::from() due to child type mismatch.

Which issue does this PR close?gg

Cherry-picked from upstream arrow-rs 56.1.0 (PR apache#7627, issue apache#7165).
Drop this commit when upgrading arrow-rs to >= 56.1.0.

Original: Fix RowConverter panic when encoding DictionaryArrays in
StructArray / ListArray. The RowConverter flattens Dictionary types
during encoding but didn't account for this when decoding, causing
List<Dictionary<K,V>> and Struct containing Dictionary fields to
panic in GenericListArray::from() due to child type mismatch.
Copilot AI review requested due to automatic review settings March 27, 2026 14:36
@github-actions github-actions Bot added the arrow label Mar 27, 2026

Copilot AI 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.

Pull request overview

Fixes a panic in arrow-row row decoding when RowConverter encounters nested DictionaryArray values inside StructArray and ListArray by correcting the decoded nested schema to match the flattened child array types.

Changes:

  • Update list decoding to build ArrayData using a corrected (Large)List element DataType derived from the decoded child array
  • Update struct decoding to build ArrayData using corrected Struct field DataTypes derived from decoded child arrays
  • Add regression tests covering Dictionary-in-Struct and List-of-Dictionary roundtrips (including empty struct)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
arrow-row/src/list.rs Corrects (Large)List decoded DataType to match flattened child array types
arrow-row/src/lib.rs Corrects Struct decoded field types to match flattened child array types; adds regression tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread arrow-row/src/list.rs
Comment thread arrow-row/src/lib.rs
Comment thread arrow-row/src/lib.rs
All 0.11.0-0.11.5 versions have been yanked from crates.io.
@avantgardnerio
avantgardnerio requested a review from a team March 27, 2026 17:01

@avantgardnerio avantgardnerio 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.

I trust a cherry pick if the conflicts were minimal and the tests pass.

Just a reminder to set the PR message right before merge to include those upstream IDs

@dispanser
dispanser merged commit 122c198 into v55 Mar 27, 2026
27 checks passed
@dispanser
dispanser deleted the tp/fix-row-converter-for-dictionary branch March 27, 2026 17:02
dispanser added a commit that referenced this pull request Mar 30, 2026
#77)

* BUGV2-5495: Fix RowConverter panic with DictionaryArray in Struct/List

Cherry-picked from upstream arrow-rs 56.1.0 (PR apache#7627, issue apache#7165).
Drop this commit when upgrading arrow-rs to >= 56.1.0.

Original: Fix RowConverter panic when encoding DictionaryArrays in
StructArray / ListArray. The RowConverter flattens Dictionary types
during encoding but didn't account for this when decoding, causing
List<Dictionary<K,V>> and Struct containing Dictionary fields to
panic in GenericListArray::from() due to child type mismatch.

* Bump lz4_flex upper bound to 0.11.6

All 0.11.0-0.11.5 versions have been yanked from crates.io.
dispanser added a commit that referenced this pull request Mar 30, 2026
#77) (#78)

* BUGV2-5495: Fix RowConverter panic with DictionaryArray in Struct/List

Cherry-picked from upstream arrow-rs 56.1.0 (PR apache#7627, issue apache#7165).
Drop this commit when upgrading arrow-rs to >= 56.1.0.

Original: Fix RowConverter panic when encoding DictionaryArrays in
StructArray / ListArray. The RowConverter flattens Dictionary types
during encoding but didn't account for this when decoding, causing
List<Dictionary<K,V>> and Struct containing Dictionary fields to
panic in GenericListArray::from() due to child type mismatch.
avantgardnerio pushed a commit that referenced this pull request Apr 2, 2026
#77) (#78)

* BUGV2-5495: Fix RowConverter panic with DictionaryArray in Struct/List

Cherry-picked from upstream arrow-rs 56.1.0 (PR apache#7627, issue apache#7165).
Drop this commit when upgrading arrow-rs to >= 56.1.0.

Original: Fix RowConverter panic when encoding DictionaryArrays in
StructArray / ListArray. The RowConverter flattens Dictionary types
during encoding but didn't account for this when decoding, causing
List<Dictionary<K,V>> and Struct containing Dictionary fields to
panic in GenericListArray::from() due to child type mismatch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants