Fix IPC roundtripping dicts nested in ListViews#9126
Merged
alamb merged 1 commit intoapache:mainfrom Jan 10, 2026
Merged
Conversation
9 tasks
alamb
approved these changes
Jan 9, 2026
| | DataType::FixedSizeList(field, _) | ||
| | DataType::Map(field, _) => field.fields(), | ||
| DataType::Dictionary(_, value_field) => Field::_fields(value_field.as_ref()), | ||
| DataType::RunEndEncoded(_, field) => field.fields(), |
Contributor
There was a problem hiding this comment.
I wonder if we should (as a separate PR) add DataType::Union and DataType::Map too 🤔
Contributor
Author
There was a problem hiding this comment.
looks like it works fine, but doesn't hurt to have some extra tests to ensure it doesn't break: #9146
| assert_eq!(in_batch, out_batch); | ||
| } | ||
|
|
||
| fn test_roundtrip_list_view_of_dict_impl<OffsetSize: OffsetSizeTrait, U: ArrowNativeType>( |
Contributor
There was a problem hiding this comment.
I verified these tests fail without the provided code fix
failures:
---- writer::tests::test_roundtrip_large_list_view_of_dict stdout ----
thread 'writer::tests::test_roundtrip_large_list_view_of_dict' (26537286) panicked at arrow-ipc/src/writer.rs:2145:32:
called `Result::unwrap()` on an `Err` value: ParseError("Cannot find a dictionary batch with dict id: 0")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- writer::tests::test_roundtrip_list_view_of_dict stdout ----
thread 'writer::tests::test_roundtrip_list_view_of_dict' (26537289) panicked at arrow-ipc/src/writer.rs:2145:32:
called `Result::unwrap()` on an `Err` value: ParseError("Cannot find a dictionary batch with dict id: 0")
---- writer::tests::test_roundtrip_sliced_list_view_of_dict stdout ----
thread 'writer::tests::test_roundtrip_sliced_list_view_of_dict' (26537290) panicked at arrow-ipc/src/writer.rs:2145:32:
called `Result::unwrap()` on an `Err` value: ParseError("Cannot find a dictionary batch with dict id: 0")
failures:
writer::tests::test_roundtrip_large_list_view_of_dict
writer::tests::test_roundtrip_list_view_of_dict
writer::tests::test_roundtrip_sliced_list_view_of_dict
test result: FAILED. 92 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.73s
44 tasks
Jefffrey
approved these changes
Jan 10, 2026
Contributor
alamb
pushed a commit
that referenced
this pull request
Jan 13, 2026
# Which issue does this PR close? No known issue, but this confirms that nested dicts do indeed work in Map and Union arrays. It was brought up here: #9126 (comment) # Rationale for this change Ensure that IPC roundtripping nested dicts works in Map and Union arrays. # What changes are included in this PR? Unit tests testing the functionality. # Are these changes tested? The whole PR consists of tests only. # Are there any user-facing changes? No @alamb @Jefffrey
Dandandan
pushed a commit
to Dandandan/arrow-rs
that referenced
this pull request
Jan 15, 2026
# Which issue does this PR close? Closes apache#9125 # Rationale for this change Fixes correct handling of dict building for IPC when ListView is used. # What changes are included in this PR? Creating schemas correctly and reading dict IDs correctly when ListView occurs in IPC. # Are these changes tested? Yes, see new unit tests. # Are there any user-facing changes? No, just a bug fix. @alamb
Dandandan
pushed a commit
to Dandandan/arrow-rs
that referenced
this pull request
Jan 15, 2026
…e#9146) # Which issue does this PR close? No known issue, but this confirms that nested dicts do indeed work in Map and Union arrays. It was brought up here: apache#9126 (comment) # Rationale for this change Ensure that IPC roundtripping nested dicts works in Map and Union arrays. # What changes are included in this PR? Unit tests testing the functionality. # Are these changes tested? The whole PR consists of tests only. # Are there any user-facing changes? No @alamb @Jefffrey
asubiotto
pushed a commit
to polarsignals/arrow-rs
that referenced
this pull request
Jan 22, 2026
# Which issue does this PR close? Closes apache#9125 # Rationale for this change Fixes correct handling of dict building for IPC when ListView is used. # What changes are included in this PR? Creating schemas correctly and reading dict IDs correctly when ListView occurs in IPC. # Are these changes tested? Yes, see new unit tests. # Are there any user-facing changes? No, just a bug fix. @alamb
asubiotto
pushed a commit
to polarsignals/arrow-rs
that referenced
this pull request
Feb 9, 2026
# Which issue does this PR close? Closes apache#9125 # Rationale for this change Fixes correct handling of dict building for IPC when ListView is used. # What changes are included in this PR? Creating schemas correctly and reading dict IDs correctly when ListView occurs in IPC. # Are these changes tested? Yes, see new unit tests. # Are there any user-facing changes? No, just a bug fix. @alamb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #9125
Rationale for this change
Fixes correct handling of dict building for IPC when ListView is used.
What changes are included in this PR?
Creating schemas correctly and reading dict IDs correctly when ListView occurs in IPC.
Are these changes tested?
Yes, see new unit tests.
Are there any user-facing changes?
No, just a bug fix.
@alamb