Skip to content

Administration Commands

The administration commands provide observability into past pipeline runs, quality metrics trends, storage optimization recommendations, table compaction, storage profiling, and data archival.


Show run history and model execution history from the embedded state store. Displays past pipeline runs with their duration, status, and per-model details.

Terminal window
rocky history [flags]
FlagTypeDefaultDescription
--model <NAME>stringFilter history to a specific model.
--since <DATE>stringOnly show runs since this date (ISO 8601 or YYYY-MM-DD).

Show all recent run history:

Terminal window
rocky history
{
"version": "0.1.0",
"command": "history",
"runs": [
{
"run_id": "run_20260401_143022",
"started_at": "2026-04-01T14:30:22Z",
"duration_ms": 45200,
"filter": "client=acme",
"tables_copied": 20,
"tables_failed": 0,
"status": "success"
},
{
"run_id": "run_20260401_080015",
"started_at": "2026-04-01T08:00:15Z",
"duration_ms": 52100,
"filter": "client=acme",
"tables_copied": 19,
"tables_failed": 1,
"status": "partial"
}
]
}

Show history for a specific model since a date:

Terminal window
rocky history --model fct_revenue --since 2026-03-01
{
"version": "0.1.0",
"command": "history",
"model": "fct_revenue",
"executions": [
{
"run_id": "run_20260401_143022",
"started_at": "2026-04-01T14:30:22Z",
"duration_ms": 2300,
"strategy": "incremental",
"status": "success",
"watermark": "2026-04-01T14:00:00Z"
},
{
"run_id": "run_20260331_143005",
"started_at": "2026-03-31T14:30:05Z",
"duration_ms": 8900,
"strategy": "full_refresh",
"status": "success",
"watermark": "2026-03-31T14:00:00Z",
"note": "drift detected, full refresh triggered"
}
]
}

Show history with table output:

Terminal window
rocky -o table history --since 2026-04-01
run_id | started_at | duration | copied | failed | status
-------------------------+-----------------------+-----------+--------+--------+--------
run_20260401_143022 | 2026-04-01T14:30:22Z | 45.2s | 20 | 0 | success
run_20260401_080015 | 2026-04-01T08:00:15Z | 52.1s | 19 | 1 | partial

Show quality metrics for a model, including row counts, null rates, freshness, and trend data across recent runs.

Terminal window
rocky metrics <model> [flags]
ArgumentTypeDefaultDescription
modelstring(required)Model name to show metrics for.
FlagTypeDefaultDescription
--trendboolfalseShow metric trends over recent runs.
--column <NAME>stringFilter to a specific column.
--alertsboolfalseShow quality alerts (anomalies, threshold breaches).

Show metrics for a model:

Terminal window
rocky metrics fct_revenue
{
"version": "0.1.0",
"command": "metrics",
"model": "fct_revenue",
"row_count": 148203,
"last_updated": "2026-04-01T14:30:22Z",
"columns": [
{ "name": "customer_id", "null_rate": 0.0, "distinct_count": 12450 },
{ "name": "revenue_month", "null_rate": 0.0, "distinct_count": 24 },
{ "name": "net_revenue", "null_rate": 0.0, "min": 0.50, "max": 52340.00 }
]
}

Show trends over recent runs:

Terminal window
rocky metrics fct_revenue --trend
{
"version": "0.1.0",
"command": "metrics",
"model": "fct_revenue",
"trend": [
{ "run_id": "run_20260401_143022", "row_count": 148203, "duration_ms": 2300 },
{ "run_id": "run_20260331_143005", "row_count": 145890, "duration_ms": 8900 },
{ "run_id": "run_20260330_143010", "row_count": 143200, "duration_ms": 2100 }
]
}

Show alerts for a specific column:

Terminal window
rocky metrics fct_revenue --column net_revenue --alerts
{
"version": "0.1.0",
"command": "metrics",
"model": "fct_revenue",
"column": "net_revenue",
"alerts": [
{
"type": "anomaly",
"message": "null rate increased from 0.0% to 2.3% in last run",
"severity": "warning",
"detected_at": "2026-04-01T14:30:22Z"
}
]
}

Analyze materialization costs and recommend strategy changes. Reviews execution history, row counts, and query patterns to suggest whether a model should use incremental, full refresh, or table materialization.

Terminal window
rocky optimize [flags]
FlagTypeDefaultDescription
--model <NAME>stringFilter to a specific model. If omitted, analyzes all models.

Analyze all models:

Terminal window
rocky optimize
{
"version": "0.1.0",
"command": "optimize",
"recommendations": [
{
"model": "fct_revenue",
"current_strategy": "incremental",
"recommended_strategy": "incremental",
"reason": "Incremental is optimal. Average 2.3s per run, 1.2% of rows processed each run."
},
{
"model": "dim_customers",
"current_strategy": "table",
"recommended_strategy": "incremental",
"reason": "Full refresh takes 18.5s and processes 250K rows. Only 0.3% change rate between runs. Switching to incremental would save ~17s per run.",
"estimated_savings_ms": 17000
},
{
"model": "stg_events",
"current_strategy": "incremental",
"recommended_strategy": "table",
"reason": "Drift detected in 4 of last 5 runs, triggering full refresh anyway. Switching to table materialization avoids drift detection overhead.",
"estimated_savings_ms": 500
}
]
}

Analyze a single model:

Terminal window
rocky optimize --model dim_customers
{
"version": "0.1.0",
"command": "optimize",
"recommendations": [
{
"model": "dim_customers",
"current_strategy": "table",
"recommended_strategy": "incremental",
"reason": "Full refresh takes 18.5s and processes 250K rows. Only 0.3% change rate between runs.",
"estimated_savings_ms": 17000
}
]
}

Generate OPTIMIZE and VACUUM SQL for storage compaction on Delta tables. Combines small files, removes old versions, and optionally targets a specific file size.

Terminal window
rocky compact <model> [flags]
ArgumentTypeDefaultDescription
modelstring(required)Target table in catalog.schema.table format.
FlagTypeDefaultDescription
--target-size <SIZE>stringTarget file size (e.g., 256MB, 512MB, 1GB).
--dry-runboolfalseShow SQL without executing.

Compact a table (dry run):

Terminal window
rocky compact acme_warehouse.staging__us_west__shopify.orders --dry-run
{
"version": "0.1.0",
"command": "compact",
"model": "acme_warehouse.staging__us_west__shopify.orders",
"dry_run": true,
"statements": [
{ "sql": "OPTIMIZE acme_warehouse.staging__us_west__shopify.orders" },
{ "sql": "VACUUM acme_warehouse.staging__us_west__shopify.orders" }
]
}

Compact with a target file size:

Terminal window
rocky compact acme_warehouse.staging__us_west__shopify.orders --target-size 256MB
{
"version": "0.1.0",
"command": "compact",
"model": "acme_warehouse.staging__us_west__shopify.orders",
"dry_run": false,
"statements": [
{ "sql": "OPTIMIZE acme_warehouse.staging__us_west__shopify.orders WHERE file_size < '256MB'" },
{ "sql": "VACUUM acme_warehouse.staging__us_west__shopify.orders" }
],
"files_compacted": 142,
"size_before_mb": 890,
"size_after_mb": 620
}

Execute compaction immediately:

Terminal window
rocky compact acme_warehouse.staging__eu_central__stripe.charges --target-size 512MB

Profile the storage layout of a table and recommend column encodings, partitioning strategies, and file format optimizations.

Terminal window
rocky profile-storage <model>
ArgumentTypeDefaultDescription
modelstring(required)Target table in catalog.schema.table format.

Profile a table:

Terminal window
rocky profile-storage acme_warehouse.staging__us_west__shopify.orders
{
"version": "0.1.0",
"command": "profile-storage",
"model": "acme_warehouse.staging__us_west__shopify.orders",
"total_size_mb": 890,
"file_count": 342,
"avg_file_size_mb": 2.6,
"columns": [
{
"name": "order_id",
"dtype": "BIGINT",
"null_rate": 0.0,
"cardinality": 1482030,
"recommendation": null
},
{
"name": "status",
"dtype": "STRING",
"null_rate": 0.0,
"cardinality": 5,
"recommendation": "Consider TINYINT encoding. Only 5 distinct values."
},
{
"name": "customer_notes",
"dtype": "STRING",
"null_rate": 0.72,
"cardinality": 98200,
"recommendation": "72% null rate. Consider splitting to a separate table."
}
],
"partitioning": {
"current": "none",
"recommendation": "Partition by order_date (month) for time-range queries"
}
}

Profile with table output:

Terminal window
rocky -o table profile-storage acme_warehouse.staging__us_west__shopify.orders
column | dtype | null_rate | cardinality | recommendation
----------------+---------+-----------+-------------+----------------------------------------------
order_id | BIGINT | 0.0% | 1,482,030 |
status | STRING | 0.0% | 5 | Consider TINYINT encoding
customer_notes | STRING | 72.0% | 98,200 | High null rate, consider separate table
order_date | DATE | 0.0% | 730 |
total_amount | DOUBLE | 0.0% | 145,200 |

Archive old data partitions by moving them to cold storage or deleting them based on an age threshold. Supports dry-run mode for previewing which partitions would be affected.

Terminal window
rocky archive [flags]
FlagTypeDefaultDescription
--older-than <DURATION>string(required)Age threshold. Accepted formats: 90d (days), 6m (months), 1y (years).
--model <NAME>stringFilter to a specific model. If omitted, archives across all models.
--dry-runboolfalseShow SQL without executing.

Preview archival for data older than 90 days:

Terminal window
rocky archive --older-than 90d --dry-run
{
"version": "0.1.0",
"command": "archive",
"dry_run": true,
"older_than": "90d",
"cutoff_date": "2026-01-02",
"candidates": [
{
"model": "acme_warehouse.staging__us_west__shopify.orders",
"partitions_affected": 3,
"estimated_rows": 45000,
"estimated_size_mb": 120
},
{
"model": "acme_warehouse.staging__us_west__shopify.events",
"partitions_affected": 12,
"estimated_rows": 2300000,
"estimated_size_mb": 890
}
]
}

Archive a specific model’s old data:

Terminal window
rocky archive --older-than 6m --model acme_warehouse.staging__us_west__shopify.events
{
"version": "0.1.0",
"command": "archive",
"dry_run": false,
"older_than": "6m",
"cutoff_date": "2025-10-02",
"archived": [
{
"model": "acme_warehouse.staging__us_west__shopify.events",
"partitions_archived": 24,
"rows_archived": 8900000,
"size_freed_mb": 3200
}
]
}

Archive across all models with a 1-year threshold:

Terminal window
rocky archive --older-than 1y --dry-run