Skip to main content

Module rs_write

Module rs_write 

Source
Expand description

Output writers for converting Arrow [RecordBatch] data to CSV, Feather (Arrow IPC), NDJSON, or Parquet format.

ReadStatWriter manages the lifecycle of format-specific writers, handling streaming writes across multiple batches. It also supports metadata output (pretty-printed or JSON), parallel CSV/NDJSON batch encoding, and native parallel Parquet column encoding.

Structsยง

ParallelParquetWriter
Parquet writer that encodes columns concurrently and commits each row group once, in order, to a single output file.
ParallelTextWriter
CSV/NDJSON writer that encodes independent batches concurrently and commits their bytes in input order.
ReadStatParquetWriter ๐Ÿ”’
Internal wrapper around the Parquet Arrow writer, allowing ownership transfer on close.
ReadStatWriter
Manages writing Arrow [RecordBatch] data to the configured output format.
StagingGuard ๐Ÿ”’

Enumsยง

ReadStatWriterFormat ๐Ÿ”’
Format-specific writer variant, created lazily on first write.

Functionsยง

csv_escape_field ๐Ÿ”’
Escapes a single CSV field per RFC 4180: if it contains a comma, double quote, CR, or LF, wrap it in double quotes and double any interior quotes.
encode_text_batch ๐Ÿ”’
write_batch_to_csv_bytes
Serialize a [RecordBatch] to CSV bytes (with header).
write_batch_to_feather_bytes
Serialize a [RecordBatch] to Feather (Arrow IPC) bytes.
write_batch_to_ndjson_bytes
Serialize a [RecordBatch] to NDJSON bytes.
write_batch_to_parquet_bytes
Serialize a [RecordBatch] to Parquet bytes with Snappy compression.