Novi UDM Data (v4) API
Get results
Check a query you ran and read its results.
Get results
/api/v2/statements/{statementHandle}Check a query you ran and read its results. 200 means it finished and the body holds the partition you asked for. 202 means it is still running: ask again.
Partitions
Partition 0 comes in the first answer that holds results, from Run a query or from this call. Ask for partition=1 up to the number of entries in partitionInfo minus one. These answers are gzip-compressed (Content-Encoding: gzip) and carry no metadata, so keep resultSetMetaData from the first answer.
Link header
Link holds URLs for the first, next, prev and last partitions.
Retries
While a query runs, Snowflake can also answer 429. Retry with backoff.
Parameters
Path parameters
statementHandlestringRequiredFormat
uuidThe
statementHandlefrom Run a query.
Query parameters
partitionintegerOptionalFormat
int64≥ 0The partition of results to return, from 0 to the number of partitions minus one.
Header parameters
User-AgentstringRequiredYour application's name and version, for example
myApplication/1.0. Snowflake requires a value that complies with RFC 7231.
Responses
The query finished. The body holds the requested partition of the results.
codestringOptionalSnowflake status code.
090001means the statement ran successfully.sqlStatestringOptionalmessagestringOptionalstatementHandlestringOptionalFormat
uuidThe statement's ID. Use it with Get results and Cancel a query.
createdOnintegerOptionalFormat
int64When the statement started, in milliseconds since the epoch.
statementStatusUrlstringOptionalFormat
uri-referencePath to the statement's status and results.
resultSetMetaDataobjectOptionalColumns, row count and partitions of the whole result. Sent with the first partition only.
ShowHide 4 child fields
numRowsintegerOptionalFormat
int64Total rows across all partitions.
formatstringOptionalFormat of
data. Alwaysjsonv2."jsonv2"rowTypearray of objectsOptionalOne entry per column, in column order.
ShowHide 6 child fields in each item
namestringOptionalColumn name.
typestringOptionalSnowflake data type of the column.
lengthinteger or nullOptionalFormat
int64Length of the column.
precisioninteger or nullOptionalFormat
int64Precision of the column.
scaleinteger or nullOptionalFormat
int64Scale of the column.
nullablebooleanOptionalWhether the column can hold NULL.
partitionInfoarray of objectsOptionalOne entry per partition. The first describes the rows in this response.
ShowHide 3 child fields in each item
rowCountintegerOptionalFormat
int64≥ 0Rows in the partition.
uncompressedSizeintegerOptionalFormat
int64≥ 0Partition size in bytes, uncompressed.
compressedSizeintegerOptionalFormat
int64≥ 0Partition size in bytes, compressed. Not always present.
dataarray of arraysOptionalRows of this partition. Each row is an array of column values in
rowTypeorder, each a JSON string ornull.
Still running. Ask again.
statementHandlestringRequiredFormat
uuidThe statement's ID. Use it with Get results and Cancel a query.
codestringOptionalSnowflake status code.
333334means the query is still running.sqlStatestringOptionalmessagestringOptionalcreatedOnintegerOptionalFormat
int64When the statement started, in milliseconds since the epoch.
statementStatusUrlstringOptionalFormat
uri-referencePath to the statement's status and results.
Errors
| Status | When |
|---|---|
| 422 | The statement failed. |
| 429 | Too many requests, or too many at once. Retry with exponential backoff and jitter. |
Shared errors400401403404500503504What they mean