Open
Conversation
AndreaBozzo
suggested changes
Mar 31, 2026
Contributor
AndreaBozzo
left a comment
There was a problem hiding this comment.
while i'm very in favor of the idea behind this, there a few concerns about the implementation
| mut state: AvroReaderState<R>, | ||
| ) -> impl Stream<Item = Result<RecordBatch, ArrowError>> + Send + 'static { | ||
| async_stream::try_stream! { | ||
| if state.meta.range.start >= state.meta.range.end { |
Contributor
There was a problem hiding this comment.
try_stream! is sequential? There's no actual prefetching or concurrent work happening, did i miss something?
| tokio = { version = "1.0", optional = true, default-features = false, features = ["macros", "rt", "io-util"] } | ||
| tokio-util = { version = "0.7.18", default-features = false, features = ["io"] } | ||
| async-stream = "0.3.6" | ||
|
|
Contributor
There was a problem hiding this comment.
Async stuff should be feature gated i think
Author
There was a problem hiding this comment.
do you mean feature gating AsyncFileReader entirely (which wasn't feature gated before) or having two implementations for it (which I disklike)?
Contributor
There was a problem hiding this comment.
The dependencies should be optional and enabled by the "async" feature, like tokio above.
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?
Rationale for this change
Implement an async streamed reader for avro, this is similar to how datafusion handles json and csv scanning.
There are two main advantages:
What changes are included in this PR?
Change the avro reader implementation to use async streams.
Are these changes tested?
Yes, added tests.
Are there any user-facing changes?
Users can now implement get_stream as part of the
AsyncFileReadertrait