Skip to main content

submit_spark_sql(options)

Submit a Spark SQL query that writes its result to an Iceberg output table. Returns run info immediately; use get_run() or submit_spark_sql_and_wait() to poll status.

Parameters

str
required
Job namespace.
str
required
Job name.
str
required
The Spark SQL query to execute.
str
required
The Iceberg table the query result is written to.
SparkWriteMode
default:"OVERWRITE"
OVERWRITE or APPEND. Case-insensitive on input.
SparkMachineType
default:"spark.1.b"
Driver machine type.
SparkMachineType
default:"spark.1.b"
Executor machine type.
int
default:"2"
Number of executors, from 1 to 20.

Return type: SparkSqlSubmitResponse


submit_spark_sql_and_wait(options)

Submit a Spark SQL query and poll until the run reaches a terminal state (COMPLETE, FAIL, or ABORT). Raises TimeoutError if the timeout is exceeded.
Accepts all submit_spark_sql options plus:
int
default:"10000"
Milliseconds between status polls. Must be greater than 0.
int
default:"600000"
Maximum time to wait in milliseconds before raising TimeoutError.

Return type: SubmitAndWaitResult