l>

documentation

Parquet interop

Read, write, and stream Apache Parquet files from l.

The Parquet interop package is an Apache Parquet reader, writer, and streamer for l. The Parquet format work is handled by the Arrow Rust parquet crate; l loads the resulting shared library through 2:.

l-labs/parquet_interop

Load from l

.pq.read:  `:target/release/libl_parquet 2: (`pq_read; 1)
.pq.write: `:target/release/libl_parquet 2: (`pq_write; 1)
.pq.stream:`:target/release/libl_parquet 2: (`pq_stream; 1)

First round trip

.pq.write[([]sym:`AAPL`GOOG;price:150.5 175.3); `:/tmp/out.parquet]
t:.pq.read `:/tmp/out.parquet
n:.pq.stream[`:/tmp/huge.parquet; `:/tmp/db/t]

.pq.stream writes native splay files chunk by chunk and patches counts at the end, so get and \l can load the result directly.

Type mapping

l typeParquet or Arrow typeReadWriteNotes
KB boolBooleanyesyesnull reads as 0b
KG byteUInt8, Int8 acceptedyesyes
KH, KI, KJInt16, Int32, Int64yesyes0Ni and 0Nj map to null
KE, KFFloat32, Float64yesyes0n maps to null for f64
KS symbolUtf8yesyesdictionary-encoded on disk
KD dateDate32 dayyesyesepoch shift 2000 to 1970
KP timestampTimestamp s, ms, us, ns to nsyesyesepoch shift, null-preserving
KN timespanDuration nsyesyesvia embedded Arrow schema
KZ datetimeTimestamp nsnoyesreads back as KP

Nested columns such as List, Struct, and Map raise 'nyi.