pub struct ArrowRowGroupWriterFactory {
schema_plan: Result<Arc<ArrowWriteSchemaPlan>, ArrowWriteSchemaPlanError>,
props: WriterPropertiesPtr,
page_store_factory: Arc<dyn PageStoreFactory>,
file_encryptor: Option<Arc<FileEncryptor>>,
}Expand description
Factory that creates new column writers for each row group in the Parquet file.
Create this structure with Self::try_new or ArrowWriter::into_serialized_writer.
See the example on ArrowColumnWriter for how to encode columns in parallel
Fields§
§schema_plan: Result<Arc<ArrowWriteSchemaPlan>, ArrowWriteSchemaPlanError>§props: WriterPropertiesPtr§page_store_factory: Arc<dyn PageStoreFactory>§file_encryptor: Option<Arc<FileEncryptor>>Implementations§
Source§impl ArrowRowGroupWriterFactory
impl ArrowRowGroupWriterFactory
Sourcepub fn new<W: Write + Send>(
file_writer: &SerializedFileWriter<W>,
arrow_schema: SchemaRef,
) -> Self
👎Deprecated since 60.2.0: Use ArrowRowGroupWriterFactory::try_new instead
pub fn new<W: Write + Send>( file_writer: &SerializedFileWriter<W>, arrow_schema: SchemaRef, ) -> Self
Use ArrowRowGroupWriterFactory::try_new instead
Create a new ArrowRowGroupWriterFactory for the provided file writer and Arrow schema.
Schema-planning errors are deferred until Self::create_column_writers is called.
Use Self::try_new to return these errors during construction instead.
Sourcepub fn try_new<W: Write + Send>(
file_writer: &SerializedFileWriter<W>,
arrow_schema: SchemaRef,
) -> Result<Self>
pub fn try_new<W: Write + Send>( file_writer: &SerializedFileWriter<W>, arrow_schema: SchemaRef, ) -> Result<Self>
Try to create a new ArrowRowGroupWriterFactory for the provided file writer and Arrow schema.
Validates and caches the schema-only field-to-leaf mapping for reuse across row groups.
§Errors
Returns schema-planning errors immediately, including invalid map-key schemas and mismatched Arrow and Parquet leaf counts.
fn from_schema_plan<W: Write + Send>( file_writer: &SerializedFileWriter<W>, schema_plan: Result<Arc<ArrowWriteSchemaPlan>, ArrowWriteSchemaPlanError>, ) -> Self
Sourcepub fn with_page_store_factory(
self,
page_store_factory: Arc<dyn PageStoreFactory>,
) -> Self
pub fn with_page_store_factory( self, page_store_factory: Arc<dyn PageStoreFactory>, ) -> Self
Set the PageStoreFactory used to allocate the buffer for each column
chunk, e.g. to spill completed pages to a temp file or object storage
instead of the heap. Defaults to InMemoryPageStoreFactory.
fn create_row_group_writer( &self, row_group_index: usize, ) -> Result<ArrowRowGroupWriter>
Sourcepub fn create_column_writers(
&self,
row_group_index: usize,
) -> Result<Vec<ArrowColumnWriter>>
pub fn create_column_writers( &self, row_group_index: usize, ) -> Result<Vec<ArrowColumnWriter>>
Create column writers for a new row group, with the given row group index