Skip to main content

submitSparkSql(options)

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

Parameters

options.namespace
string
required
Job namespace.
options.name
string
required
Job name.
options.query
string
required
The Spark SQL query to execute.
options.outputTable
string
required
The Iceberg table the query result is written to.
options.writeMode
string
default:"OVERWRITE"
OVERWRITE or APPEND. Case-insensitive on input.
options.driverMachineType
SparkMachineType
default:"spark.1.b"
Driver machine type.
options.executorMachineType
SparkMachineType
default:"spark.1.b"
Executor machine type.
options.executorNumbers
number
default:"2"
Number of executors, from 1 to 20.

Return type: SparkSqlSubmitResponse

FieldTypeDescription
run_idstringThe ID of the submitted run
statestringInitial run state (for example, SUBMITTED)
namespacestringJob namespace
job_namestringJob name
pipeline_idnullable stringPipeline ID if one exists
submitted_atstringISO timestamp of submission
computeobjectdriver_machine_type, executor_machine_type, executor_numbers
output_tablestringThe output table
write_modestringThe write mode used

submitSparkSqlAndWait(options)

Submit a Spark SQL query and poll until the run reaches a terminal state (COMPLETE, FAIL, or ABORT). Throws an error if the timeout is exceeded.
Accepts all submitSparkSql options plus:
options.pollIntervalMs
number
default:"10000"
Milliseconds between status polls.
options.timeoutMs
number
default:"600000"
Maximum time to wait in milliseconds before throwing a timeout error.

Return shape

FieldTypeDescription
runIdstringThe ID of the submitted run
statestringTerminal state (COMPLETE, FAIL, or ABORT)
runRunResponseFull run details