Nova API — /api/query-log
The operations Nova tags public under /api/query-log. Generated from reference-src/nova-openapi.json.
GET /api/query-log
Operation id query_log_list: in Python client.call("query_log_list", …), on the command line stardelt api query_log_list.
GET /api/query-log?scope=mine|team|all&state=&warehouse=&q=&from=&to=&limit=&cursor=
The statements run on the engine, newest first, a page at a time. A person sees their own; an administrator may ask for everyone's with scope=all. Times are epoch milliseconds. With NOVA_QUERY_LOG_REDACT_LITERALS=1 somebody else's statement shows '?' in place of every string literal.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string | No | The nextCursor of the previous page |
from | query | integer | No | Created at or after this time |
limit | query | integer | No | Page size from 1 to 200; 50 by default |
q | query | string | No | Text inside the statement, or an exact query id; at most 200 characters |
scope | query | string | No | mine (default), team or all. team is the queries of the service principals owned by the caller's groups; all is for administrators |
state | query | string | No | QUEUED, FINISHED, FAILED or CANCELED, in any case |
to | query | integer | No | Created at or before this time |
warehouse | query | string | No | Only queries that ran on this warehouse |
Responses
| Code | Description |
|---|---|
200 | One page of the log |
400 | A parameter is not valid; the message names it |
401 | Not signed in |
403 | scope=all by somebody who is not an administrator |
503 | The state store is not configured |
GET /api/query-log/repeated
Operation id query_log_repeated: in Python client.call("query_log_repeated", …), on the command line stardelt api query_log_repeated.
The statements the caller runs repeatedly, worst first (stardelt#38): the last 30 days of FINISHED queries, grouped by their shape (string literals and whitespace do not split a group; numeric literals do), at least 2 runs per group, ordered by total execution time. scope is mine (default), team (the service principals the caller's groups own) or all (administrators only); limit is 1 to 100, default 20. The answer carries one sentence about the supported acceleration path — a sql task with CREATE OR REPLACE TABLE … AS SELECT … in a scheduled pipeline. Nothing is created or changed.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | No | How many groups, 1 to 100 (default 20) |
scope | query | string | No | mine (default), team, or all for administrators |
Responses
| Code | Description |
|---|---|
200 | The repeated statements |
400 | scope or limit is not one of the accepted values |
401 | Not signed in |
403 | The all scope is for administrators |
503 | The state store is not configured |
GET /api/query-log/usage
Operation id query_log_usage: in Python client.call("query_log_usage", …), on the command line stardelt api query_log_usage.
GET /api/query-log/usage?scope=&by=&warehouse=&from=&to= — compute and bytes added up.
Compute and bytes added up per person, warehouse, day or group, with the query log's visibility: your own, your team's service principals, or everyone's for administrators. A group is the groups claim the person's token carried at the last write to the person directory; a principal the directory does not know, such as the superset service account, and a person with no group fall into one honest 'unknown' row. A person in several groups appears in each of them, so the total counts every query once. The window defaults to the last 7 days. When a price per CPU-hour is configured, each row carries an estimated cost — an estimate, never a bill.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
by | query | string | No | principal (default), warehouse, day (UTC) or group (the groups the sign-in token carried) |
from | query | integer | No | Created at or after this time; the last 7 days by default |
scope | query | string | No | mine (default), team or all. team is the service principals owned by the caller's groups; all is for administrators |
to | query | integer | No | Created at or before this time; now by default |
warehouse | query | string | No | Only usage of this warehouse |
Responses
| Code | Description |
|---|---|
200 | The rows of the window and their total |
400 | A parameter is not valid; the message names it |
401 | Not signed in |
403 | scope=all by somebody who is not an administrator |
503 | The state store is not configured |
GET /api/query-log/{id}
Operation id query_log_detail: in Python client.call("query_log_detail", …), on the command line stardelt api query_log_detail.
GET /api/query-log/{id} — everything stored about one query the caller may see.
One query with its whole statement. Somebody else's query answers 404, exactly like a missing one; an administrator who opens another person's query is audited. With NOVA_QUERY_LOG_REDACT_LITERALS=1 somebody else's statement shows '?' in place of every string literal.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The engine's query id |
Responses
| Code | Description |
|---|---|
200 | The stored query |
401 | Not signed in |
404 | No such query, or it is not the caller's to see |
503 | The state store is not configured |
GET /api/query-log/{id}/history
Operation id query_log_history: in Python client.call("query_log_history", …), on the command line stardelt api query_log_history.
GET /api/query-log/{id}/history — the last runs of the same statement, and whether this one is slower than their median.
The last 20 runs of the same statement by the same principal: each one's state, end time, wall and execution time, bytes and rows read, newest first. The same visibility rule as the detail: somebody else's query answers 404, exactly like a missing one, and an administrator who opens another person's history is audited. medianWallMs is the median of the returned runs' wall times; slower is true when this run's wall time is more than twice that median and at least three runs were compared. Answers Cache-Control: no-store.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The engine's query id |
Responses
| Code | Description |
|---|---|
200 | The runs of the same statement, newest first |
401 | Not signed in |
404 | No such query, or it is not the caller's to see |
503 | The state store is not configured |
GET /api/query-log/{id}/profile
Operation id query_log_profile: in Python client.call("query_log_profile", …), on the command line stardelt api query_log_profile.
GET /api/query-log/{id}/profile — where one finished query spent its time: the engine's plan and the per-operator statistics it reported.
The plan and per-operator statistics of one finished query. The same rule as the detail: somebody else's query answers 404, exactly like a missing one, and an administrator who opens another person's profile is audited. A query without a stored profile answers 404 with a sentence (still running, older than the profile retention, or the engine sent none). With NOVA_QUERY_LOG_REDACT_LITERALS=1 somebody else's plan shows '?' in place of every string literal. The answer also carries "hints", an array of deterministic suggestions computed from the profile and the query's timing, each with its evidence and a documentation link; an empty array means no rule found evidence.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The engine's query id |
Responses
| Code | Description |
|---|---|
200 | The stored profile: plan, operators, spill and split counts, inputs |
401 | Not signed in |
404 | No such query, it is not the caller's to see, or it has no profile |
503 | The state store is not configured |