pub trait PageReader: Iterator<Item = Result<Page>> + Send {
    // Required methods
    fn get_next_page(&mut self) -> Result<Option<Page>>;
    fn peek_next_page(&mut self) -> Result<Option<PageMetadata>>;
    fn skip_next_page(&mut self) -> Result<()>;

    // Provided method
    fn at_record_boundary(&mut self) -> Result<bool> { ... }
}
Expand description

API for reading pages from a column chunk. This offers a iterator like API to get the next page.

Required Methods§

source

fn get_next_page(&mut self) -> Result<Option<Page>>

Gets the next page in the column chunk associated with this reader. Returns None if there are no pages left.

source

fn peek_next_page(&mut self) -> Result<Option<PageMetadata>>

Gets metadata about the next page, returns an error if no column index information

source

fn skip_next_page(&mut self) -> Result<()>

Skips reading the next page, returns an error if no column index information

Provided Methods§

source

fn at_record_boundary(&mut self) -> Result<bool>

Returns true if the next page can be assumed to contain the start of a new record

Prior to parquet V2 the specification was ambiguous as to whether a single record could be split across multiple pages, and prior to (#4327) the Rust writer would do this in certain situations. However, correctly interpreting the offset index relies on this assumption holding (#4943), and so this mechanism is provided for a PageReader to signal this to the calling context

Implementors§