Skip to content
Pivot is in early development and is not production ready. See Project status.

COMPACT

COMPACT improves a table’s physical file layout by merging small Parquet files and re-sorting files with overlapping sort-key ranges.

Run a compaction round on an existing table:

COMPACT events;
COMPACT [datastore.][schema.]table [FINAL];

Regular COMPACT merges small files and re-sorts overlapping files until no further merges qualify under the normal compaction rules. These rules use file sizes, file counts, and the amount of overlap to decide when to merge.

The datastore’s compaction settings control output targets and concurrency.

COMPACT events FINAL;

FINAL runs a more aggressive compaction. It relaxes the normal merge thresholds, merging remaining small files and re-sorting eligible files until no two have overlapping sort-key ranges within a partition.