Concepts¶
A Parquet file is a sequence of row groups followed by a footer. Each row group has one column chunk per leaf column. The footer records the schema and, for every column chunk, where it starts, how long it is, its encodings, its compression and its statistics.
To concatenate files, pq-glue:
- reads each input's footer (and page indexes, if any);
- checks that the inputs share one schema, key-value metadata and column orders;
- copies each input's column chunks, in order, to the output as bytes;
- writes a new footer, with each column chunk's offsets moved to its new position;
- restores the inputs' column orders in that footer (Column orders).
No page is decompressed or decoded, so the cost is that of copying the bytes, and the memory used does not grow with the size of the files.
- What is copied
- Column orders
- Column encodings: writing a column in an encoding of its own
with
write_parquet