Skip to main content

Module arrow_writer

Module arrow_writer 

Source
Expand description

Contains writer which writes arrow data into parquet data.

Re-exportsΒ§

use crate::column::chunker::ContentDefinedChunker; πŸ”’
use bytes::Bytes; πŸ”’
use std::io::Write; πŸ”’
use std::ops::Range; πŸ”’
use std::slice::Iter; πŸ”’
use std::sync::Arc; πŸ”’
use std::sync::Mutex; πŸ”’
use std::vec::IntoIter; πŸ”’
use arrow_array::cast::AsArray; πŸ”’
use arrow_array::ArrayRef; πŸ”’
use arrow_array::Int32Array; πŸ”’
use arrow_array::RecordBatch; πŸ”’
use arrow_array::RecordBatchWriter; πŸ”’
use arrow_array::new_empty_array; πŸ”’
use arrow_array::PrimitiveArray; πŸ”’
use arrow_schema::ArrowError; πŸ”’
use arrow_schema::DataType as ArrowDataType; πŸ”’
use arrow_schema::Field; πŸ”’
use arrow_schema::FieldRef; πŸ”’
use arrow_schema::IntervalUnit; πŸ”’
use arrow_schema::SchemaRef; πŸ”’
use arrow_schema::TimeUnit; πŸ”’
use super::schema::add_encoded_arrow_schema_to_metadata; πŸ”’
use super::schema::decimal_length_from_precision; πŸ”’
use super::schema::validate_map_key_type; πŸ”’
use crate::arrow::ArrowSchemaConverter; πŸ”’
use crate::arrow::arrow_writer::byte_array::ByteArrayEncoder; πŸ”’
use crate::basic::PageType; πŸ”’
use crate::column::page::CompressedPage; πŸ”’
use crate::column::page::PageWriteSpec; πŸ”’
use crate::column::page::PageWriter; πŸ”’
use crate::column::page_encryption::PageEncryptor; πŸ”’
use crate::column::writer::encoder::ColumnValueEncoder; πŸ”’
use crate::column::writer::ColumnCloseResult; πŸ”’
use crate::column::writer::ColumnWriter; πŸ”’
use crate::column::writer::ColumnWriterImpl; πŸ”’
use crate::column::writer::GenericColumnWriter; πŸ”’
use crate::column::writer::get_column_writer; πŸ”’
use crate::data_type::ByteArray; πŸ”’
use crate::data_type::FixedLenByteArray; πŸ”’
use crate::data_type::FixedLenByteArrayType; πŸ”’
use std::collections::HashSet; πŸ”’
use crate::encryption::encrypt::FileEncryptor; πŸ”’
use crate::errors::ParquetError; πŸ”’
use crate::errors::Result; πŸ”’
use crate::file::metadata::KeyValue; πŸ”’
use crate::file::metadata::ParquetMetaData; πŸ”’
use crate::file::metadata::RowGroupMetaData; πŸ”’
use crate::file::properties::WriterProperties; πŸ”’
use crate::file::properties::WriterPropertiesPtr; πŸ”’
use crate::file::writer::SerializedFileWriter; πŸ”’
use crate::file::writer::SerializedRowGroupWriter; πŸ”’
use crate::parquet_thrift::ThriftCompactOutputProtocol; πŸ”’
use crate::parquet_thrift::WriteThrift; πŸ”’
use crate::schema::types::ColumnDescPtr; πŸ”’
use crate::schema::types::SchemaDescriptor; πŸ”’
use levels::ArrayLevels; πŸ”’
use levels::calculate_array_levels; πŸ”’
use arrow_array::types::*; πŸ”’

ModulesΒ§

byte_array πŸ”’
levels πŸ”’
Parquet definition and repetition levels

StructsΒ§

ArrowColumnChunk
The data for a single column chunk, see ArrowColumnWriter
ArrowColumnChunkData πŸ”’
A single column chunk produced by ArrowColumnWriter.
ArrowColumnWriter
Encodes ArrowLeafColumn to ArrowColumnChunk
ArrowColumnWriterFactory πŸ”’
Creates ArrowColumnWriter instances
ArrowLeafColumn
A leaf column that can be encoded by ArrowColumnWriter
ArrowPageWriter πŸ”’
ArrowRowGroupWriter πŸ”’
Encodes [RecordBatch] to a parquet row group
ArrowRowGroupWriterFactory
Factory that creates new column writers for each row group in the Parquet file.
ArrowTopLevelWriterSpec πŸ”’
Associates a top-level Arrow field with its range of Parquet leaf writers.
ArrowWriteSchemaPlan πŸ”’
Immutable schema glue shared by every row group.
ArrowWriter
Encodes [RecordBatch] to parquet
ArrowWriterOptions
Arrow-specific configuration settings for writing parquet files.
InMemoryPageStore
The default PageStore, holding blobs on the heap in a Vec<Bytes>.
InMemoryPageStoreFactory
Factory for InMemoryPageStore β€” the default used by ArrowWriter.
PageKey
An opaque, store-allocated handle to a blob held by a PageStore.
PageStoreArgs
Context for a single PageStoreFactory::create call.
StreamingColumnChunkPages πŸ”’
A streaming iterator over one column chunk’s buffered page blobs, in final file order: the dictionary page (if any) first, then the data pages.
WriteFixedLenByteArray πŸ”’
Writes the values passed to it to a FIXED_LEN_BYTE_ARRAY column
WritePrimitive πŸ”’
Writes the values passed to it to an INT32 or INT64 column

EnumsΒ§

ArrowColumnWriterImpl πŸ”’
ArrowWriteSchemaPlanError πŸ”’
Replayable schema-planning errors kept only for the deprecated ArrowRowGroupWriterFactory::new constructor. It cannot return errors, and repeated create_column_writers(&self) calls need fresh owned errors. ArrowRowGroupWriterFactory::try_new returns the original error directly.

TraitsΒ§

FixedLenByteArrayVisitor πŸ”’
Receives the values ArrowWriter stores for an Arrow array in a FIXED_LEN_BYTE_ARRAY column, which are also the values hashed into the column’s bloom filter
NativeDecimalType πŸ”’
PageStore
A pluggable store for completed, serialized page blobs.
PageStoreFactory
Creates a fresh PageStore for each column chunk.
PrimitiveVisitor πŸ”’
Receives the values ArrowWriter stores for an Arrow array in an INT32 (T = i32) or INT64 (T = i64) column, which are also the values hashed into the column’s bloom filter

FunctionsΒ§

chunk_array_slice πŸ”’
chunk_contiguous_vec πŸ”’
compute_leaves
Computes the ArrowLeafColumn for a potentially nested [ArrayRef]
fixed_byte_width πŸ”’
Returns the fixed byte width for primitive Arrow types, or None for variable-length types.
get_bool_array_slice πŸ”’
hash_bytes πŸ”’
Hash a byte slice to a u64 for NDV tracking.
update_distinct_values_seen πŸ”’
Hash the non-null values in array (at non_null_indices) into seen.
visit_decimal πŸ”’
Passes the big-endian two’s complement bytes of the values of array to visitor
visit_fixed_len_byte_array πŸ”’
Passes the values ArrowWriter stores for column in a FIXED_LEN_BYTE_ARRAY column to visitor
visit_i32 πŸ”’
Passes the values ArrowWriter stores for column in an INT32 column to visitor
visit_i64 πŸ”’
Passes the values ArrowWriter stores for column in an INT64 column to visitor
write_leaf πŸ”’
write_primitive πŸ”’

Type AliasesΒ§

DistinctValuesSet πŸ”’
SharedColumnChunk πŸ”’
A shared ArrowColumnChunkData