-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Deprecate MetadataLoader
#6474
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
Merged
Merged
Deprecate MetadataLoader
#6474
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5843f45
deprecate MetadataLoader
etseidl cb1498a
change signature of the load functions
etseidl 5f07723
fix up fetch_parquet_metadata
etseidl 7e669cc
can now use self.meta.size directly
etseidl 8068a31
revert changes to load API
etseidl 388cf5a
revert change to test code
etseidl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
revert changes to load API
- Loading branch information
commit 8068a31e3536730d8606f82a4151d19d817f0869
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -299,14 +299,11 @@ impl ParquetMetaDataReader { | |
| /// See [`Self::with_prefetch_hint`] for a discussion of how to reduce the number of fetches | ||
| /// performed by this function. | ||
| #[cfg(feature = "async")] | ||
| pub async fn load_and_finish<F>( | ||
| pub async fn load_and_finish<F: MetadataFetch>( | ||
| mut self, | ||
| fetch: &mut F, | ||
| fetch: F, | ||
| file_size: usize, | ||
| ) -> Result<ParquetMetaData> | ||
| where | ||
| for<'a> &'a mut F: MetadataFetch, | ||
| { | ||
| ) -> Result<ParquetMetaData> { | ||
| self.try_load(fetch, file_size).await?; | ||
| self.finish() | ||
| } | ||
|
|
@@ -317,12 +314,13 @@ impl ParquetMetaDataReader { | |
| /// See [`Self::with_prefetch_hint`] for a discussion of how to reduce the number of fetches | ||
| /// performed by this function. | ||
| #[cfg(feature = "async")] | ||
| pub async fn try_load<F>(&mut self, fetch: &mut F, file_size: usize) -> Result<()> | ||
| where | ||
| for<'a> &'a mut F: MetadataFetch, | ||
| { | ||
| pub async fn try_load<F: MetadataFetch>( | ||
| &mut self, | ||
| mut fetch: F, | ||
| file_size: usize, | ||
| ) -> Result<()> { | ||
| let (metadata, remainder) = | ||
| Self::load_metadata(fetch, file_size, self.get_prefetch_size()).await?; | ||
| Self::load_metadata(&mut fetch, file_size, self.get_prefetch_size()).await?; | ||
|
|
||
| self.metadata = Some(metadata); | ||
|
|
||
|
|
@@ -337,22 +335,16 @@ impl ParquetMetaDataReader { | |
| /// Asynchronously fetch the page index structures when a [`ParquetMetaData`] has already | ||
| /// been obtained. See [`Self::new_with_metadata()`]. | ||
| #[cfg(feature = "async")] | ||
| pub async fn load_page_index<F>(&mut self, fetch: &mut F) -> Result<()> | ||
| where | ||
| for<'a> &'a mut F: MetadataFetch, | ||
| { | ||
| pub async fn load_page_index<F: MetadataFetch>(&mut self, fetch: F) -> Result<()> { | ||
|
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 change will be breaking if in 52.2.0. I'll revert this if need be. I found having |
||
| self.load_page_index_with_remainder(fetch, None).await | ||
| } | ||
|
|
||
| #[cfg(feature = "async")] | ||
| async fn load_page_index_with_remainder<F>( | ||
| async fn load_page_index_with_remainder<F: MetadataFetch>( | ||
| &mut self, | ||
| mut fetch: &mut F, | ||
| mut fetch: F, | ||
| remainder: Option<(usize, Bytes)>, | ||
| ) -> Result<()> | ||
| where | ||
| for<'a> &'a mut F: MetadataFetch, | ||
| { | ||
| ) -> Result<()> { | ||
| if self.metadata.is_none() { | ||
| return Err(general_err!("Footer metadata is not present")); | ||
| } | ||
|
|
@@ -507,14 +499,11 @@ impl ParquetMetaDataReader { | |
| } | ||
|
|
||
| #[cfg(feature = "async")] | ||
| async fn load_metadata<F>( | ||
| mut fetch: &mut F, | ||
| async fn load_metadata<F: MetadataFetch>( | ||
| fetch: &mut F, | ||
| file_size: usize, | ||
| prefetch: usize, | ||
| ) -> Result<(ParquetMetaData, Option<(usize, Bytes)>)> | ||
| where | ||
| for<'a> &'a mut F: MetadataFetch, | ||
| { | ||
| ) -> Result<(ParquetMetaData, Option<(usize, Bytes)>)> { | ||
| if file_size < FOOTER_SIZE { | ||
| return Err(eof_err!("file size of {} is less than footer", file_size)); | ||
| } | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.