Skip to main content
POST
/
api
/
v2
/
spark
/
query
Spark
curl --request POST \
  --url https://oleander.dev/api/v2/spark/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "namespace": "oleander.query",
  "name": "flowers_copy",
  "query": "SELECT * FROM oleander.default.flowers",
  "output_table": "oleander.default.flowers_query_spark_sql",
  "driver_machine_type": "spark.1.b",
  "executor_machine_type": "spark.1.b",
  "executor_numbers": 1
}
'
{
  "run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "job": {
    "namespace": "<string>",
    "name": "<string>"
  },
  "output_table": "<string>",
  "status": "RUNNING"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
namespace
string
required

Job namespace used to identify this query in lineage and run history.

Example:

"oleander.query"

name
string
required

Job name. Combined with namespace to form the unique job identity.

Example:

"flowers_copy"

query
string
required

SQL query to execute. Supports all Spark SQL syntax and can reference any table in your Iceberg catalogs.

Example:

"SELECT * FROM oleander.default.flowers"

output_table
string
required

Destination Iceberg table for query results. Format: catalog.namespace.table. The table is created if it does not exist.

Example:

"oleander.default.flowers_query_spark_sql"

driver_machine_type
string
default:spark.1.b

Machine type for the Spark driver.

Example:

"spark.1.b"

executor_machine_type
string
default:spark.1.b

Machine type for each Spark executor.

Example:

"spark.1.b"

executor_numbers
integer
default:1

Number of Spark executors to allocate.

Example:

1

Response

Query submitted successfully.

run_id
string<uuid>

Run ID for this Spark query execution. Use this to track the run in the oleander platform.

job
object
output_table
string

The destination table results will be written to.

status
string

Initial run status.

Example:

"RUNNING"