Query (routed)
The unified query endpoint. oleander parses the SQL, estimates how much data the referenced tables hold, and picks the engine (DuckDB, Polars, Bloom, or Spark) and machine size to match. Leave engine on auto unless you need a specific one.
Interactive reads return rows on the call. A query with a destination, a statement that names its own target, or a read too large for an interactive engine is submitted asynchronously and returns state: "SUBMITTED" with a run_id to poll.
This endpoint supersedes /api/v1/warehouse/query, which pins DuckDB and is sized by the org default rather than by the query.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Provide either query or script, never both.
The SQL to run.
"SELECT species, count(*) AS n FROM oleander.default.flowers GROUP BY 1"
A Polars DataFrame script that assigns result. Mutually exclusive with query; forces the Polars engine.
"result = events.group_by('day').len()"
Tables a script reads, as "alias=namespace.table" or {alias, table}. Script mode only.
Ask for a specific engine. An impossible combination returns an engine capability error rather than rerouting.
auto, duckdb, polars, bloom, spark Table to write the result to, as a dotted identifier such as namespace.table. Presence of a destination makes this a write.
"default.daily_counts"
Applies to a destination write. A statement that names its own target carries its own semantics.
overwrite, append Return the routing decision without executing anything or spending compute.
Response
Query executed, submitted, or explained.
true
Present and true when explain was requested. No compute was spent and no other result fields are returned.
How the query router chose the engine and machine for this run.
Rows, for interactive reads only. Absent on submitted runs.
"42ms"
COMPLETE means the write already landed. SUBMITTED means a job is running and run_id must be polled.
COMPLETE, SUBMITTED Run to poll when state is SUBMITTED.
Fully qualified destination table for a write.
The sandbox or cluster that actually served the run. A warm larger sandbox can serve a smaller request, and that is the machine the org is billed for.
Lineage job identity for this query.