-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Potentially buffer multiple RecordBatches before writing a parquet row group in ArrowWriter
#1214
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
Changes from 2 commits
03cb4ca
9dbfdf2
1802ab9
65454bb
4185fa7
e894fa8
e552b7a
9d10c2d
326461b
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 |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ | |
| //! | ||
| //! \[1\] [parquet-format#nested-encoding](https://github.com/apache/parquet-format#nested-encoding) | ||
|
|
||
| use arrow::array::{make_array, ArrayRef, MapArray, StructArray}; | ||
| use arrow::array::{make_array, Array, ArrayRef, MapArray, StructArray}; | ||
| use arrow::datatypes::{DataType, Field}; | ||
|
|
||
| /// Keeps track of the level information per array that is needed to write an Arrow array to Parquet. | ||
|
|
@@ -711,12 +711,11 @@ impl LevelInfo { | |
| ((0..=(len as i64)).collect(), array_mask) | ||
| } | ||
| DataType::List(_) | DataType::Map(_, _) => { | ||
| let data = array.data(); | ||
| let offsets = unsafe { data.buffers()[0].typed_data::<i32>() }; | ||
| let offsets = unsafe { array.data().buffers()[0].typed_data::<i32>() }; | ||
| let offsets = offsets | ||
| .to_vec() | ||
| .into_iter() | ||
| .skip(offset) | ||
| .skip(array.offset() + offset) | ||
|
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. This was a pre-existing bug, that people would have run into if they wrote a sliced RecordBatch
Contributor
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. Filed #1226 to track (so that we can document this in the release notes) |
||
| .take(len + 1) | ||
| .map(|v| v as i64) | ||
| .collect::<Vec<i64>>(); | ||
|
|
@@ -729,7 +728,7 @@ impl LevelInfo { | |
| DataType::LargeList(_) => { | ||
| let offsets = unsafe { array.data().buffers()[0].typed_data::<i64>() } | ||
| .iter() | ||
| .skip(offset) | ||
| .skip(array.offset() + offset) | ||
| .take(len + 1) | ||
| .copied() | ||
| .collect(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.