Ted-Jiang commented on code in PR #1998: URL: https://github.com/apache/arrow-rs/pull/1998#discussion_r912606829
########## parquet/src/column/page.rs: ########## @@ -187,12 +187,29 @@ impl PageWriteSpec { } } +/// Contains metadata for a page +pub struct PageMetadata { + /// The number of rows in this page + pub num_rows: usize, + + /// Returns true if the page is a dictionary page + pub is_dict: bool, +} + /// API for reading pages from a column chunk. /// This offers a iterator like API to get the next page. pub trait PageReader: Iterator<Item = Result<Page>> + Send { /// Gets the next page in the column chunk associated with this reader. /// Returns `None` if there are no pages left. fn get_next_page(&mut self) -> Result<Option<Page>>; + + /// Gets metadata about the next page, returns an error if no + /// column index information + fn peek_next_page(&self) -> Result<Option<PageMetadata>>; Review Comment: 👍 really need this abstraction! -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org