Skip to main content

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

NameInTypeRequiredDescription
cursorquerystringNoThe nextCursor of the previous page
fromqueryintegerNoCreated at or after this time
limitqueryintegerNoPage size from 1 to 200; 50 by default
qquerystringNoText inside the statement, or an exact query id; at most 200 characters
scopequerystringNomine (default), team or all. team is the queries of the service principals owned by the caller's groups; all is for administrators
statequerystringNoQUEUED, FINISHED, FAILED or CANCELED, in any case
toqueryintegerNoCreated at or before this time
warehousequerystringNoOnly queries that ran on this warehouse

Responses

CodeDescription
200One page of the log
400A parameter is not valid; the message names it
401Not signed in
403scope=all by somebody who is not an administrator
503The 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

NameInTypeRequiredDescription
limitqueryintegerNoHow many groups, 1 to 100 (default 20)
scopequerystringNomine (default), team, or all for administrators

Responses

CodeDescription
200The repeated statements
400scope or limit is not one of the accepted values
401Not signed in
403The all scope is for administrators
503The 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

NameInTypeRequiredDescription
byquerystringNoprincipal (default), warehouse, day (UTC) or group (the groups the sign-in token carried)
fromqueryintegerNoCreated at or after this time; the last 7 days by default
scopequerystringNomine (default), team or all. team is the service principals owned by the caller's groups; all is for administrators
toqueryintegerNoCreated at or before this time; now by default
warehousequerystringNoOnly usage of this warehouse

Responses

CodeDescription
200The rows of the window and their total
400A parameter is not valid; the message names it
401Not signed in
403scope=all by somebody who is not an administrator
503The 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

NameInTypeRequiredDescription
idpathstringYesThe engine's query id

Responses

CodeDescription
200The stored query
401Not signed in
404No such query, or it is not the caller's to see
503The 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

NameInTypeRequiredDescription
idpathstringYesThe engine's query id

Responses

CodeDescription
200The runs of the same statement, newest first
401Not signed in
404No such query, or it is not the caller's to see
503The 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

NameInTypeRequiredDescription
idpathstringYesThe engine's query id

Responses

CodeDescription
200The stored profile: plan, operators, spill and split counts, inputs
401Not signed in
404No such query, it is not the caller's to see, or it has no profile
503The state store is not configured