etseidl commented on code in PR #11438:
URL: https://github.com/apache/arrow-rs/pull/11438#discussion_r4235075345
##########
parquet/src/file/metadata/reader.rs:
##########
@@ -573,6 +574,78 @@ impl ParquetMetaDataReader {
self.read_page_indexes_sized(reader, reader.len())
}
+ /// Reads and returns the page index structures described by the stored
+ /// [`ParquetMetaData`].
+ ///
+ /// Unlike [`Self::read_page_indexes`], this returns the decoded
[`PageIndex`] separately
+ /// instead of attaching it to the metadata. This is useful for populating
an external page
+ /// index cache. The configured page index policies and masks determine
which indexes are
+ /// returned.
+ ///
+ /// This operation consumes `self` and the stored [`ParquetMetaData`]. Use
+ /// [`Self::new_with_metadata`] to construct the reader.
+ pub fn read_page_index<R: ChunkReader>(self, reader: &R) ->
Result<Option<PageIndex>> {
Review Comment:
That was a deliberate decision by me to add justification for the easy to
clone metadata 😄. I also think it's weird for a `get_page_index` kind of call
to return a tuple. But I guess we could go that way if people don't like the
clone.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]