Skip to navigation

Run read-only SQL over a lakehouse namespace

Beta

Run one SELECT over a lakehouse namespace you can view, as yourself, and get its columns and rows. The namespace must be shared with you (VIEW on the namespace asset, in your current workspace), and the statement may read only that namespace’s tables: a table of any other namespace is refused (403). The statement is one SELECT in StarRocks SQL (WITH … SELECT and UNION, INTERSECT or EXCEPT of SELECTs included); anything else is refused (403): a write or schema change, SHOW, DESCRIBE, EXPLAIN, or more than one statement. The engine returns at most 2,000 rows for one statement (truncated says when more matched) and cancels a statement after 60 s. The public edge closes a connection that has waited about as long, so a statement that runs that long usually ends in a closed connection rather than an answer: keep statements well under a minute. The same read Athena’s SQL workbench runs, except that a member’s SharePoint projection is not read here. It is a person’s read: their session or API key, or staff acting as them. A credential held by a computer, a preview or an agent’s session, and a person’s key sent from an agent’s session, is refused (403).

Authentication

X-API-KEYstring
API Key authentication via header

Path parameters

asset_idstringRequired

Headers

X-Athena-Session-CredentialstringOptional

Request

This endpoint expects an object.
sqlstringRequired1-100000 characters

One SELECT in StarRocks SQL: a plain SELECT, WITH … SELECT, or SELECTs joined by UNION, INTERSECT or EXCEPT. It may read only this namespace’s tables, named <catalog>.<namespace>.<table>; a table of any other namespace is refused (403). Any other statement is refused (403): a write or schema change, SHOW, DESCRIBE, EXPLAIN, or more than one statement. A blank statement is refused (422).

max_rowsinteger or nullOptional1-10000

Rows to return. Defaults to 1,000; at most 10,000 may be asked for, and the lakehouse engine returns at most 2,000 for one statement. truncated in the answer says when more rows matched.

Response

Successful Response
asset_idstring
The lakehouse namespace asset the statement read
columnslist of objects
The result's columns, in order
row_countinteger

How many rows rows holds

rowslist of lists of any

The result’s rows, each a list of values in columns order

truncatedboolean

True when more rows matched than were returned: the request’s max_rows, or the engine’s cap of 2,000 rows per statement

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
502
Bad Gateway Error