-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[WIP] fix: read Dict(FixedSizeBinary) from parquet without dict encoding
#10232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -185,8 +185,18 @@ impl<K: ArrowNativeType + Ord, V: OffsetSizeTrait> DictionaryBuffer<K, V> { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| ArrowType::Dictionary(k, v) => (k, v.as_ref().clone()), | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| _ => unreachable!(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| let array = if let ArrowType::FixedSizeBinary(size) = value_type { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Matching what was done above in the arrow-rs/parquet/src/arrow/buffer/dictionary_buffer.rs Lines 159 to 168 in 7616e10
This is because arrow-rs/parquet/src/arrow/buffer/offset_buffer.rs Lines 132 to 146 in 7616e10
Which is the wrong structure for a fixedsizebinary array (we don't have offsets buffer, etc.) |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| let array = values.into_array(null_buffer, ArrowType::Binary); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| let array = array.as_binary::<i32>(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Arc::new(FixedSizeBinaryArray::new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| size, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| array.values().clone(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| array.nulls().cloned(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| )) as _ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| values.into_array(null_buffer, value_type) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| let array = values.into_array(null_buffer, value_type); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| pack_values(key_type, &array) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the reproduction, added
one_column_roundtrip()usage here to test roundtrip where one of the cases is disabling dictionary encoding entirelyRest of test changes is just restructuring