Skip to main content

ThriftMetadataWriter

Struct ThriftMetadataWriter 

Source
pub(crate) struct ThriftMetadataWriter<'a, W: Write> {
    buf: &'a mut TrackedWrite<W>,
    schema_descr: &'a SchemaDescPtr,
    row_groups: Vec<RowGroupMetaData>,
    page_index: Option<Arc<dyn PageIndexProvider>>,
    key_value_metadata: Option<Vec<KeyValue>>,
    created_by: Option<String>,
    object_writer: MetadataObjectWriter,
    writer_version: i32,
    write_path_in_schema: bool,
    preserve_page_index_locations: bool,
}
Expand description

Writes crate::file::metadata structures to a thrift encoded byte stream

See ParquetMetaDataWriter for background and example.

Fields§

§buf: &'a mut TrackedWrite<W>§schema_descr: &'a SchemaDescPtr§row_groups: Vec<RowGroupMetaData>§page_index: Option<Arc<dyn PageIndexProvider>>§key_value_metadata: Option<Vec<KeyValue>>§created_by: Option<String>§object_writer: MetadataObjectWriter§writer_version: i32§write_path_in_schema: bool§preserve_page_index_locations: bool

Implementations§

Source§

impl<'a, W: Write> ThriftMetadataWriter<'a, W>

Source

fn write_offset_indexes( &mut self, page_index: &dyn PageIndexProvider, ) -> Result<()>

Serialize all the offset indexes to self.buf,

Note: also updates the ColumnChunk::offset_index_offset and ColumnChunk::offset_index_length to reflect the position and length of the serialized offset indexes.

Source

fn write_column_indexes( &mut self, page_index: &dyn PageIndexProvider, ) -> Result<()>

Serialize all the column indexes to the self.buf

Note: also updates the ColumnChunk::column_index_offset and ColumnChunk::column_index_length to reflect the position and length of the serialized column indexes.

Source

fn clear_page_indexes(&mut self)

Source

pub(crate) fn finish(self) -> Result<ParquetMetaData>

Assembles and writes the final metadata to self.buf

Source

pub(crate) fn new( buf: &'a mut TrackedWrite<W>, schema_descr: &'a SchemaDescPtr, row_groups: Vec<RowGroupMetaData>, created_by: Option<String>, writer_version: i32, write_path_in_schema: bool, preserve_page_index_locations: bool, ) -> Self

Source

pub(crate) fn with_page_index( self, page_index: Arc<dyn PageIndexProvider>, ) -> Self

Source

pub(crate) fn with_key_value_metadata( self, key_value_metadata: Vec<KeyValue>, ) -> Self

Source

pub(crate) fn with_file_encryptor( self, file_encryptor: Option<Arc<FileEncryptor>>, ) -> Self

Auto Trait Implementations§

§

impl<'a, W> !RefUnwindSafe for ThriftMetadataWriter<'a, W>

§

impl<'a, W> !UnwindSafe for ThriftMetadataWriter<'a, W>

§

impl<'a, W> Freeze for ThriftMetadataWriter<'a, W>
where &'a mut TrackedWrite<W>: Freeze,

§

impl<'a, W> Send for ThriftMetadataWriter<'a, W>
where &'a mut TrackedWrite<W>: Send,

§

impl<'a, W> Sync for ThriftMetadataWriter<'a, W>
where &'a mut TrackedWrite<W>: Sync,

§

impl<'a, W> Unpin for ThriftMetadataWriter<'a, W>
where &'a mut TrackedWrite<W>: Unpin,

§

impl<'a, W> UnsafeUnpin for ThriftMetadataWriter<'a, W>
where &'a mut TrackedWrite<W>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Ungil for T
where T: Send,