All Products
Search
Document Center

E-MapReduce:Spark Shell job configuration

Last Updated:Jul 17, 2026

You can configure a Spark Shell job to run interactive Spark scripts in your EMR cluster.

Prerequisites

Ensure you have created a project. For more information, see project management.

Procedure

  1. Go to the Projects page in Data Platform.

    1. Log in to the E-MapReduce console with your Alibaba Cloud account.

    2. In the top navigation bar, select the region and resource group.

    3. Click the Data Development tab.

  2. In the row of the project you want to edit, click Edit Job.

  3. Create a Spark Shell job.
    1. On the left side of the page, right-click the target folder and select Create Job.
    2. In the Create Job dialog box, enter a job name and job description, and select Spark Shell from the Job Type drop-down list.
    3. Click OK.
  4. Edit the job content.
    1. In the job content field, enter the Spark Shell script.
      This example uses the Monte Carlo method to estimate the value of Pi.
      val count = sc.parallelize(1 to 100).filter { _ =>
        val x = math.random
        val y = math.random
        x*x + y*y < 1
      }.count();
      println("Pi is roughly ${4.0 * count / 100}")
    2. Click Save.