feat(parquet): support object versions in ParquetObjectReader#9753
Open
ClSlaid wants to merge 1 commit intoapache:mainfrom
Open
feat(parquet): support object versions in ParquetObjectReader#9753ClSlaid wants to merge 1 commit intoapache:mainfrom
ClSlaid wants to merge 1 commit intoapache:mainfrom
Conversation
Code: add with_version and use ObjectStore::get_opts for suffix, single-range, and multi-range reads when a version is set. Test: add a self-contained regression test using a temporary local object store. Fix: ensure parquet metadata and data are read from the requested object revision instead of the latest object state.
Contributor
Author
|
/cc @yeya24 PTAL. |
alamb
reviewed
Apr 22, 2026
Comment on lines
+207
to
+212
| self.spawn(|store, path| { | ||
| async move { | ||
| let resp = store.get_opts(path, options).await?; | ||
| Ok::<_, ParquetError>(resp.bytes().await?) | ||
| } | ||
| .boxed() |
Contributor
There was a problem hiding this comment.
Why do we need the async closure here? Can we simplify this to something like this
store.get_opts(path, options).await.boxed()| impl AsyncFileReader for ParquetObjectReader { | ||
| fn get_bytes(&mut self, range: Range<u64>) -> BoxFuture<'_, Result<Bytes>> { | ||
| self.spawn(|store, path| store.get_range(path, range).boxed()) | ||
| if self.version.is_some() { |
Contributor
There was a problem hiding this comment.
Maybe I am missing something but the version is not passed to the options... So how does it make it into the request?
I also think it would be easier to read this code if you use the same async closure and just changed the ptions
let mut options = self.get_opts(Some(GetRange::from(range)));
if let Some(version) = self.version.as_ref() {
options = options.woth_version(version);
}
self.spawn(|store, path| store.get_opts(path, options).boxed())| } | ||
|
|
||
| #[tokio::test] | ||
| async fn test_simple_with_version() { |
Contributor
There was a problem hiding this comment.
How do these very the version is passed through? Do they fail if you revert the code changes?
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.
Summary
ParquetObjectReader::with_versionand useObjectStore::get_optsfor suffix, single-range, and multi-range reads when a version is specifiedTesting
cargo test -p parquet --features object_store,arrow test_simple_with_version -- --nocaptureFix [Parquet] Support version in ParquetObjectReader #8568