Nova API — /api/statements
The operations Nova tags public under /api/statements. Generated from reference-src/nova-openapi.json.
GET /api/statements
Operation id statements_list: in Python client.call("statements_list", …), on the command line stardelt api statements_list.
The statements the caller holds (at most ten), in order of their ids: state, rows read, whether the rows were cut and the seconds since the last request that named each. It answers "which ones do I hold?" when a submit says the caller already holds ten. Only the caller's own are listed. A statement another request is advancing at that moment is listed as RUNNING with rowCount 0.
Responses
| Code | Description |
|---|---|
200 | The caller's statements |
401 | Not signed in |
POST /api/statements
Operation id statements_submit: in Python client.call("statements_submit", …), on the command line stardelt api statements_submit.
Submit one SQL statement as the caller and get a handle to it. The call waits up to waitSeconds (0 to 30, default 5): when the statement ends in that time the answer is 200 and carries the first chunk of rows, otherwise it is 202 and the caller polls statements_get. A statement that fails in the engine is still 200 with state: FAILED and error.
Request body
| Field | Type | Required | Default | Description | Constraints |
|---|---|---|---|---|---|
maxRows | integer (nullable) | No | The most rows to keep, 1 to 100 000 (the default and the cap). A longer result is cut here, the query is cancelled in the engine and the statement ends SUCCEEDED with truncated: true. | min 0 | |
sql | string | Yes | One SQL statement, run with the caller's identity. | ||
waitSeconds | integer (nullable) | No | How long the call waits for the statement to end before it answers 202; 0 to 30, default 5. | min 0; format int64 |
Responses
| Code | Description |
|---|---|
200 | The statement ended within the wait |
202 | The statement is still running; poll it |
400 | The statement is empty |
401 | Not signed in |
429 | The caller already holds ten statements; read or cancel one |
502 | The query engine is not reachable |
GET /api/statements/{id}
Operation id statements_get: in Python client.call("statements_get", …), on the command line stardelt api statements_get.
The state of one of the caller's statements. Each call reads the engine's next pages with the caller's current token, for up to waitSeconds (0 to 30, default 0); the rows are read with statements_chunk_get. A statement that nobody polls for the engine's client timeout (5 minutes by default) is cancelled by the engine.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The statement id from statements_submit |
waitSeconds | query | integer | No | Wait up to this many seconds (0 to 30) for the statement to end |
Responses
| Code | Description |
|---|---|
200 | The statement |
401 | The engine refused the caller's token |
404 | No such statement of the caller's |
502 | The query engine is not reachable |
DELETE /api/statements/{id}
Operation id statements_cancel: in Python client.call("statements_cancel", …), on the command line stardelt api statements_cancel.
Cancel one of the caller's statements in the engine and forget it. Idempotent: it answers 204 whether or not the statement exists or is the caller's (it cancels only the caller's own).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The statement id |
Responses
| Code | Description |
|---|---|
204 | Cancelled, or nothing to cancel |
401 | Not signed in |
GET /api/statements/{id}/chunks/{n}
Operation id statements_chunk_get: in Python client.call("statements_chunk_get", …), on the command line stardelt api statements_chunk_get.
One chunk (1 000 rows, the last one fewer) of a statement's rows, counted from 0. A chunk exists once it is full or the statement has ended; the call does not wait. With Accept: text/csv the rows come as CSV (RFC 4180, lines end with CRLF) instead of JSON: chunk 0 starts with a row of the column names, the other chunks have none, so the chunks joined in order are one file; null is an empty cell and an array or an object is written as its JSON text.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The statement id |
n | path | integer | Yes | The chunk number, from 0 |
Responses
| Code | Description |
|---|---|
200 | The rows of the chunk |
401 | Not signed in |
404 | No such statement of the caller's, or no such chunk (yet) |