-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[10125] arrow-flight decode path optimizations #10206
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 8 commits
080628d
c9f66a1
316b8bd
0335ff4
a2c436b
1878721
4053b0a
f2fcc0c
2d22728
e7b3994
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,7 +146,7 @@ impl RecordBatchDecoder<'_> { | |
| let null_buffer = self.next_buffer()?; | ||
|
|
||
| // read the arrays for each field | ||
| let mut struct_arrays = vec![]; | ||
| let mut struct_arrays = Vec::with_capacity(struct_fields.len()); | ||
| // TODO investigate whether just knowing the number of buffers could | ||
| // still work | ||
| for struct_field in struct_fields { | ||
|
|
@@ -557,7 +557,7 @@ impl<'a> RecordBatchDecoder<'a> { | |
|
|
||
| let schema = Arc::clone(&self.schema); | ||
| if let Some(projection) = self.projection { | ||
| let mut arrays = vec![]; | ||
| let mut arrays = Vec::with_capacity(projection.len()); | ||
| // project fields | ||
| for (idx, field) in schema.fields().iter().enumerate() { | ||
| // A projected field can appear more than once, so collect all matching positions. | ||
|
|
@@ -597,7 +597,7 @@ impl<'a> RecordBatchDecoder<'a> { | |
| RecordBatch::try_new_with_options(schema, columns, &options) | ||
| } | ||
| } else { | ||
| let mut children = vec![]; | ||
| let mut children = Vec::with_capacity(schema.fields().len()); | ||
| // keep track of index as lists require more than one node | ||
| for field in schema.fields() { | ||
| let child = self.create_array(field, &mut variadic_counts)?; | ||
|
|
@@ -771,11 +771,13 @@ pub fn read_record_batch( | |
| dictionaries_by_id: &HashMap<i64, ArrayRef>, | ||
| projection: Option<&[usize]>, | ||
| metadata: &MetadataVersion, | ||
| skip_validation: UnsafeFlag, | ||
|
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. Since this is a public API it means we can't release this until the next major (breaking) API release https://docs.rs/arrow-ipc/latest/arrow_ipc/reader/fn.read_record_batch.html do we really need to make this change? Perhaps we should just direct people to use However, not much of that strucutre seems to be public at the moment: https://docs.rs/arrow-ipc/latest/arrow_ipc/reader/struct.RecordBatchDecoder.html
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. So maybe we could (as a separate PR) deprecate Then this PR would simply add the
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. I think it makes sense to make to avoid making this a breaking PR change I can just call |
||
| ) -> Result<RecordBatch, ArrowError> { | ||
| RecordBatchDecoder::try_new(buf, batch, schema, dictionaries_by_id, metadata)? | ||
| let decoder = RecordBatchDecoder::try_new(buf, batch, schema, dictionaries_by_id, metadata)? | ||
|
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. nit: we can probably make this more concise by not adding a |
||
| .with_projection(projection) | ||
| .with_require_alignment(false) | ||
| .read_record_batch() | ||
| .with_skip_validation(skip_validation); | ||
| decoder.read_record_batch() | ||
| } | ||
|
|
||
| /// Read the dictionary from the buffer and provided metadata, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.