Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

rockfish compact

Compact and merge Parquet files for storage efficiency.

Overview

The compact command merges multiple small Parquet files from recent days into larger, optimized files and removes data older than the configured retention period. This reduces file count, improves query performance, and manages disk usage.

Usage

rockfish compact [OPTIONS]

Options

OptionDescriptionDefault
-d, --data-dirParquet data directoryrequired
--sensorSensor name for partitioning
--hiveUse hive-style date partitioningfalse
--retentionData retention period30d
--dry-runPreview changes without modifying filesfalse

Examples

# Compact and prune with 30-day retention
rockfish compact -d /data --sensor prod-01 --hive --retention 30d

# Preview what would be compacted
rockfish compact -d /data --sensor prod-01 --hive --dry-run

# 90-day retention
rockfish compact -d /data --sensor prod-01 --hive --retention 90d

How It Works

  1. Scans partitioned Parquet directories for small files
  2. Merges files from the same partition into larger, optimized files
  3. Removes partitions older than the retention period
  4. Preserves all data and metadata during compaction