Repository navigation
minor : batches_to_flight_data() should not require ownership of arguments - #11010
Merged
Merged
Conversation
Jefffrey
reviewed
Sep 8, 2026
| pub fn batches_to_flight_data<'a>( | ||
| schema: &Schema, | ||
| batches: Vec<RecordBatch>, | ||
| batches: impl Iterator<Item = &'a RecordBatch>, |
Contributor
There was a problem hiding this comment.
should we accept an impl IntoIterator instead? it makes it less breaking (i think a Vec qualifies for it) and i believe its a best practice
Contributor
Author
There was a problem hiding this comment.
good idea, makes the pr even smaller
Rich-T-kid
force-pushed
the
rich-t-kid/allow-vector-re-use
branch
from
September 8, 2026 15:45
ffbae74 to
09dbec4
Compare
23 of 25 tasks
Rich-T-kid
force-pushed
the
rich-t-kid/allow-vector-re-use
branch
from
September 9, 2026 18:16
d0f94b9 to
1da9fe0
Compare
alamb
approved these changes
Sep 9, 2026
| pub fn batches_to_flight_data<'a>( | ||
| schema: &Schema, | ||
| batches: Vec<RecordBatch>, | ||
| batches: impl IntoIterator<Item = &'a RecordBatch>, |
Contributor
There was a problem hiding this comment.
To anyone else reading this -- the underlying buffers can be reused in the FlightData even if the RecordBatch itself is not. Thus this seems like a good change to me
Rich-T-kid
added a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 18, 2026
…ments (apache#11010) # Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. --> - Closes apache#4014 # Rationale for this change see apache#4014 <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> # What changes are included in this PR? change arguments of `batches_to_flight_data()` to take in an iterator so that the underlying container (typically a vecotr) does not need to take ownership. <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> # Are these changes tested? n/a <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? If this PR claims a performance improvement, please include evidence such as benchmark results. --> # Are there any user-facing changes? yes, this is a breaking change. but it should be a no-op change for existing users that used `Vec<record_batch>` <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please call them out. --> --------- Co-authored-by: rich-T-kid <richardbaah@MacBook-Air-de-Richard.local>
Rich-T-kid
added a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 21, 2026
…ments (apache#11010) # Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. --> - Closes apache#4014 # Rationale for this change see apache#4014 <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> # What changes are included in this PR? change arguments of `batches_to_flight_data()` to take in an iterator so that the underlying container (typically a vecotr) does not need to take ownership. <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> # Are these changes tested? n/a <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? If this PR claims a performance improvement, please include evidence such as benchmark results. --> # Are there any user-facing changes? yes, this is a breaking change. but it should be a no-op change for existing users that used `Vec<record_batch>` <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please call them out. --> --------- Co-authored-by: rich-T-kid <richardbaah@MacBook-Air-de-Richard.local>
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?
batches_to_flight_data()should not require ownership of arguments #4014Rationale for this change
see #4014
What changes are included in this PR?
change arguments of
batches_to_flight_data()to take in an iterator so that the underlying container (typically a vecotr) does not need to take ownership.Are these changes tested?
n/a
Are there any user-facing changes?
yes, this is a breaking change. but it should be a no-op change for existing users that used
Vec<record_batch>