All Products
Search
Document Center

E-MapReduce:Spark Submit quick start

Last Updated:Jun 21, 2026

E-MapReduce (EMR) Serverless Spark is compatible with spark-submit command-line arguments, which simplifies the job submission process. This topic provides a step-by-step example of how to develop and run a Spark Submit job.

Prerequisites

  • You have created a workspace. For more information, see Manage workspaces.

  • You have developed your application and built it into a JAR package.

Procedure

Step 1: Develop a JAR package

To help you get started quickly, this guide provides a test JAR package.

Click spark-examples_2.12-3.5.2.jar to download the test JAR package.

Note

The spark-examples_2.12-3.5.2.jar is a simple example included with Spark that calculates the value of Pi (π). You must use this JAR package with the esr-4.x engine version to submit the job. If you are using the esr-5.x engine version, download spark-examples_2.13-4.0.1.jar to complete the steps in this guide.

Step 2: Upload the JAR package to OSS

Upload spark-examples_2.12-3.5.2.jar to OSS. For instructions, see Simple upload.

Step 3: Develop and run the job

  1. On the E-MapReduce (EMR) Serverless Spark page, click Development in the left-side navigation pane.

  2. On the Development tab, click the image icon.

  3. Enter a name, select Application > Spark Submit for Type, and then click OK.

  4. Select a queue in the upper-right corner.

    For more information about how to add a queue, see Manage resource queues.

  5. In the new job editor, configure the following parameter and leave the others at their default settings. Then, click Run.

    Parameter

    Description

    Script

    Enter your Spark Submit script.

    The following code provides an example:

    --class org.apache.spark.examples.SparkPi \
    --conf spark.executor.memory=2g \
    oss://<YourBucket>/spark-examples_2.12-3.5.2.jar
  6. In the Execution Records section at the bottom, click Log Exploration in the Actions column for your job.

  7. On the Log Exploration tab, you can view the job logs.

    Select the driver log > Stdout tab. The job output, such as Pi is roughly 3.1415557077785388, appears in the stdout.log file.

Step 4: Publish the job

Important

You can use published jobs as tasks in workflow nodes.

  1. After the job completes successfully, click Publish in the upper-right corner.

  2. In the publish dialog box, enter the publish information and click OK.

(Optional) Step 5: View the Spark UI

After the job completes successfully, you can view its details in the Spark UI.

  1. In the left-side navigation pane, click Job History.

  2. On the Application page, click Spark UI in the Actions column for your job.

    The Spark UI opens in a new tab, displaying the job details.

Related documentation

After you publish a job, you can schedule it within a workflow. For more information, see Manage workflows. For a complete example of the job development and orchestration process, see SparkSQL development quick start.