Initializing playground…
← Back to roadmap

📦 Apache Parquet I/O

readParquet(data, options?) and toParquet(df, options?) implement a pure-TypeScript Apache Parquet reader and writer with no native dependencies. The implementation uses the Thrift compact protocol for metadata and PLAIN encoding for column data pages.

Supported physical types: INT32, INT64, DOUBLE, BOOLEAN, BYTE_ARRAY (UTF-8 strings). Compression: UNCOMPRESSED. Flat tables only (no nested or repeated fields). Equivalent to pandas.read_parquet() / DataFrame.to_parquet().

1 · Basic read & write

Serialize a DataFrame to a binary Parquet buffer with toParquet() and read it back with readParquet(). The buffer starts and ends with the PAR1 magic bytes.

TypeScript
Click ▶ Run to execute

2 · Column types — int, float, boolean, string

All major column types round-trip correctly. Integers use INT32 or INT64, floats use DOUBLE, booleans are bit-packed (1 byte per 8 values), and strings are BYTE_ARRAY (UTF-8).

TypeScript
Click ▶ Run to execute

3 · usecols & nRows — selective reads

Use usecols to read a subset of columns and nRows to limit the number of rows. Both options reduce memory usage and speed up parsing.

TypeScript
Click ▶ Run to execute

4 · indexCol — row index from a column

Promote any column to the DataFrame's row index by passing indexCol to readParquet(). Use writeIndex: true in toParquet() to persist the index as __index_level_0__.

TypeScript
Click ▶ Run to execute

5 · Unicode strings

BYTE_ARRAY columns are length-prefixed UTF-8. Any Unicode string — including emoji, CJK characters, and accented letters — round-trips exactly.

TypeScript
Click ▶ Run to execute

6 · Many columns — stress test

Each column is stored as a separate column chunk in the row group. There is no limit on column count.

TypeScript
Click ▶ Run to execute