Trait parquet::column::page::PageWriter

source ·
pub trait PageWriter: Send {
    // Required methods
    fn write_page(&mut self, page: CompressedPage) -> Result<PageWriteSpec>;
    fn write_metadata(&mut self, metadata: &ColumnChunkMetaData) -> Result<()>;
    fn close(&mut self) -> Result<()>;
}
Expand description

API for writing pages in a column chunk.

It is reasonable to assume that all pages will be written in the correct order, e.g. dictionary page followed by data pages, or a set of data pages, etc.

Required Methods§

source

fn write_page(&mut self, page: CompressedPage) -> Result<PageWriteSpec>

Writes a page into the output stream/sink. Returns PageWriteSpec that contains information about written page metrics, including number of bytes, size, number of values, offset, etc.

This method is called for every compressed page we write into underlying buffer, either data page or dictionary page.

source

fn write_metadata(&mut self, metadata: &ColumnChunkMetaData) -> Result<()>

Writes column chunk metadata into the output stream/sink.

This method is called once before page writer is closed, normally when writes are finalised in column writer.

source

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

Closes resources and flushes underlying sink. Page writer should not be used after this method is called.

Implementors§