Skip to main content

getSparkCluster({ name })

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


listSparkJobs(options?)

List your uploaded Spark job artifacts with pagination.

Parameters

number
default:"20"
Number of artifacts to return per page.
number
default:"0"
Number of artifacts to skip for pagination.

Return type: ListSparkJobsResult

Each SparkArtifactSummary has:

submitSparkJob(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.

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

Machine types

The SparkMachineType enum covers compute-optimized (c), balanced (b), and memory-optimized (m) options:

submitSparkJobAndWait(options)

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

getRun(runId)

Get the current status of a run. Use this to poll a job submitted with submitSparkJob().

Return type: RunResponse