Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path = "src/main.rs"
# behind a shared multi-thread tokio runtime. The `arrow` feature backs result
# decode; `upload_file` runs the presigned direct-to-storage upload flow
# (see src/sdk.rs::Api::upload).
hotdata = { version = "0.21.0", features = ["arrow"] }
hotdata = { version = "0.23.0", features = ["arrow"] }
# Shared multi-thread runtime for the sync wrapper; block_on is called
# concurrently from rayon worker threads (see src/indexes.rs). The presigned
# upload (src/sdk.rs::Api::upload) drives the SDK's async `upload_file` on this
Expand Down
2 changes: 1 addition & 1 deletion plugin/skills/hotdata/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ hotdata jobs list [--workspace-id <workspace_id>] [--job-type <type>] [--status
hotdata jobs <job_id> [--workspace-id <workspace_id>] [--output table|json|yaml]
```
- `list` shows only active jobs (`pending`, `running`) by default. Use `--all` to see all jobs.
- `--job-type`: `create_index`, `managed_load`, `database_fork`, `ivf_rebalance_sweep` (background IVF index rebalancing). (`database_fork` is accepted for forward compatibility; today a fork completes synchronously and records no job.) (`data_refresh_table` / `data_refresh_connection` were retired server-side — the engine is push-only; nothing refreshes.)
- `--job-type`: `create_index`, `managed_load`, `database_fork`, `ivf_rebalance_sweep` (background IVF index rebalancing), `rollup_build` (building a rollup), `rollup_refresh_sweep` (background rollup refresh). (`database_fork` is accepted for forward compatibility; today a fork completes synchronously and records no job.) (`data_refresh_table` / `data_refresh_connection` were retired server-side — the engine is push-only; nothing refreshes.)
- `--status`: `pending`, `running`, `succeeded`, `partially_succeeded`, `failed`.
- Use `hotdata jobs <job_id>` to inspect a specific job's status, error, and result.

Expand Down
13 changes: 12 additions & 1 deletion src/commands/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub enum JobsCommands {
/// List background jobs (shows active jobs by default)
List {
/// Filter by job type
#[arg(long, value_parser = ["create_index", "managed_load", "database_fork", "ivf_rebalance_sweep"])]
#[arg(long, value_parser = ["create_index", "managed_load", "database_fork", "ivf_rebalance_sweep", "rollup_build", "rollup_refresh_sweep"])]
job_type: Option<String>,

/// Filter by status
Expand Down Expand Up @@ -75,6 +75,8 @@ fn parse_job_type(s: &str) -> Option<JobType> {
"managed_load" => Some(JobType::ManagedLoad),
"database_fork" => Some(JobType::DatabaseFork),
"ivf_rebalance_sweep" => Some(JobType::IvfRebalanceSweep),
"rollup_build" => Some(JobType::RollupBuild),
"rollup_refresh_sweep" => Some(JobType::RollupRefreshSweep),
_ => None,
}
}
Expand Down Expand Up @@ -257,4 +259,13 @@ mod tests {
fn parse_job_type_accepts_managed_load() {
assert_eq!(parse_job_type("managed_load"), Some(JobType::ManagedLoad));
}

#[test]
fn parse_job_type_accepts_rollup_jobs() {
assert_eq!(parse_job_type("rollup_build"), Some(JobType::RollupBuild));
assert_eq!(
parse_job_type("rollup_refresh_sweep"),
Some(JobType::RollupRefreshSweep)
);
}
}
30 changes: 30 additions & 0 deletions src/commands/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ struct QueryRun {
/// Rows read from storage before filtering/aggregation, distinct from
/// `row_count` (rows returned). `None` when no table data was read.
rows_scanned: Option<u64>,
/// Whether a rollup answered the query: `used`, `not_ready`, `not_matched`
/// or `unavailable`. `None` when no table the query read has a rollup.
rollup: Option<String>,
saved_query_id: Option<String>,
saved_query_version: Option<u64>,
snapshot_id: String,
Expand All @@ -175,6 +178,7 @@ impl From<QueryRunInfo> for QueryRun {
row_count: r.row_count.flatten().map(|v| v.max(0) as u64),
bytes_scanned: r.bytes_scanned.flatten().map(|v| v.max(0) as u64),
rows_scanned: r.rows_scanned.flatten().map(|v| v.max(0) as u64),
rollup: r.rollup.flatten().map(|u| u.to_string()),
saved_query_id: r.saved_query_id.flatten(),
saved_query_version: r.saved_query_version.flatten().map(|v| v.max(0) as u64),
snapshot_id: r.snapshot_id,
Expand Down Expand Up @@ -320,6 +324,9 @@ fn print_detail(r: &QueryRun, format: &str) {
if let Some(n) = r.bytes_scanned {
println!("{}{}", label("bytes scanned:"), crate::util::human_bytes(n));
}
if let Some(ref usage) = r.rollup {
println!("{}{}", label("rollup:"), usage);
}
if let Some(ref id) = r.result_id {
println!("{}{}", label("result id:"), id);
}
Expand Down Expand Up @@ -392,6 +399,29 @@ mod tests {
assert_eq!(json["rows_scanned"], 1000);
}

/// The run record says whether a rollup answered the query; it must reach
/// the serialized output as the same string the API sends, and be null when
/// the API sends none.
#[test]
fn maps_rollup_outcome_from_wire_body() {
let body = |rollup: &str| {
format!(
r#"{{"id":"qrun_1","status":"succeeded",
"created_at":"2026-07-20T00:00:00Z",
"snapshot_id":"snap_1","sql_hash":"h","sql_text":"SELECT 1"{rollup}}}"#
)
};
let with: QueryRunInfo = serde_json::from_str(&body(r#","rollup":"not_matched""#)).unwrap();
let run: QueryRun = with.into();
assert_eq!(run.rollup.as_deref(), Some("not_matched"));
assert_eq!(serde_json::to_value(&run).unwrap()["rollup"], "not_matched");

let without: QueryRunInfo = serde_json::from_str(&body("")).unwrap();
let run: QueryRun = without.into();
assert_eq!(run.rollup, None);
assert!(serde_json::to_value(&run).unwrap()["rollup"].is_null());
}

/// A constant-expression query (e.g. `SELECT 1`) reads no table, so the API
/// omits the scanned fields; they map to `None` and serialize as null.
#[test]
Expand Down
Loading