pub struct ParquetMetaDataBuilder(ParquetMetaData);Expand description
A builder for creating / manipulating ParquetMetaData
§Example creating a new ParquetMetaData
// Create a new builder given the file metadata
let file_metadata = get_file_metadata();
// Create a row group
let row_group = RowGroupMetaData::builder(file_metadata.schema_descr_ptr())
.set_num_rows(100)
// ... (A real row group needs more than just the number of rows)
.build()
.unwrap();
// Create the final metadata
let metadata: ParquetMetaData = ParquetMetaDataBuilder::new(file_metadata)
.add_row_group(row_group)
.build();§Example modifying an existing ParquetMetaData
// Modify the metadata so only the last RowGroup remains
let metadata: ParquetMetaData = load_metadata();
let mut builder = metadata.into_builder();
// Take existing row groups to modify
let mut row_groups = builder.take_row_groups();
let last_row_group = row_groups.pop().unwrap();
let metadata = builder
.add_row_group(last_row_group)
.build();Tuple Fields§
§0: ParquetMetaDataImplementations§
Source§impl ParquetMetaDataBuilder
impl ParquetMetaDataBuilder
Sourcepub fn new(file_meta_data: FileMetaData) -> Self
pub fn new(file_meta_data: FileMetaData) -> Self
Create a new builder from a file metadata, with no row groups
Sourcepub fn new_from_metadata(metadata: ParquetMetaData) -> Self
pub fn new_from_metadata(metadata: ParquetMetaData) -> Self
Create a new builder from an existing ParquetMetaData
Sourcepub fn add_row_group(self, row_group: RowGroupMetaData) -> Self
pub fn add_row_group(self, row_group: RowGroupMetaData) -> Self
Adds a row group to the metadata
Sourcepub fn set_row_groups(self, row_groups: Vec<RowGroupMetaData>) -> Self
pub fn set_row_groups(self, row_groups: Vec<RowGroupMetaData>) -> Self
Sets all the row groups to the specified list
Sourcepub fn take_row_groups(&mut self) -> Vec<RowGroupMetaData>
pub fn take_row_groups(&mut self) -> Vec<RowGroupMetaData>
Takes ownership of the row groups in this builder, and clears the list of row groups.
This can be used for more efficient creation of a new ParquetMetaData from an existing one.
Sourcepub fn row_groups(&self) -> &[RowGroupMetaData]
pub fn row_groups(&self) -> &[RowGroupMetaData]
Return a reference to the current row groups
Sourcepub fn set_page_index(self, page_index: Option<PageIndex>) -> Self
pub fn set_page_index(self, page_index: Option<PageIndex>) -> Self
Sets the column index
Sourcepub fn take_page_index(&mut self) -> Option<PageIndex>
pub fn take_page_index(&mut self) -> Option<PageIndex>
Returns the current column index from the builder, replacing it with None
Sourcepub fn page_index(&self) -> Option<&PageIndex>
pub fn page_index(&self) -> Option<&PageIndex>
Return a reference to the current column index, if any
Sourcepub(crate) fn set_file_decryptor(
self,
file_decryptor: Option<FileDecryptor>,
) -> Self
pub(crate) fn set_file_decryptor( self, file_decryptor: Option<FileDecryptor>, ) -> Self
Sets the file decryptor needed to decrypt this metadata.
Sourcepub fn build(self) -> ParquetMetaData
pub fn build(self) -> ParquetMetaData
Creates a new ParquetMetaData from the builder
Trait Implementations§
Source§impl From<ParquetMetaData> for ParquetMetaDataBuilder
impl From<ParquetMetaData> for ParquetMetaDataBuilder
Source§fn from(meta_data: ParquetMetaData) -> Self
fn from(meta_data: ParquetMetaData) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ParquetMetaDataBuilder
impl !UnwindSafe for ParquetMetaDataBuilder
impl Freeze for ParquetMetaDataBuilder
impl Send for ParquetMetaDataBuilder
impl Sync for ParquetMetaDataBuilder
impl Unpin for ParquetMetaDataBuilder
impl UnsafeUnpin for ParquetMetaDataBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more