get_spark_cluster(name_or_options)
Look up Spark cluster details before submitting a job. Use oleander for the built-in managed cluster or the name of a registered external cluster.
Return shape
list_spark_jobs(options?)
List your uploaded Spark job artifacts with pagination.
Parameters
Number of artifacts to return per page. Must be greater than 0.
Number of artifacts to skip for pagination. Must be 0 or greater.
Return type: ListSparkJobsResult
Each
SparkArtifactSummary has:
submit_spark_job(options)
Submit a Spark job for execution. cluster defaults to oleander.
For oleander-managed Spark, entrypoint is the uploaded script name. For external clusters, entrypoint is cluster-specific, such as an S3 URI for EMR Serverless or a Glue job name for Glue.
The canonical field is entrypoint. script_name is still accepted as a compatibility alias.
Common options
Oleander-managed options
EMR Serverless options
Glue options
For Glue jobs,
args are converted into key-value pairs. Pass them as alternating entries such as ["--source", "s3://bucket/input", "--target", "s3://bucket/output"].External cluster example
Return type: SparkJobRun
Machine types
TheSparkMachineType enum covers compute-optimized (c), balanced (b), and memory-optimized (m) options:
submit_spark_job_and_wait(options)
Submit a Spark job and poll until it reaches a terminal state (COMPLETE, FAIL, or ABORT). Raises TimeoutError if the timeout is exceeded.
submit_spark_job options plus:
Milliseconds between status polls. Must be greater than 0.
Maximum time to wait in milliseconds before raising
TimeoutError.Return type: SubmitAndWaitResult
get_run(run_id)
Get the current status of a run. Use this to poll a job submitted with submit_spark_job().