This topic describes how to configure a Spark Shell job.

Prerequisites

A project is created. For more information, see Manage projects.

Procedure

  1. Log on to the Alibaba Cloud E-MapReduce console with an Alibaba Cloud account.
  2. Click the Data Platform tab.
  3. In the Projects section, click Edit Job in the row of a project.
  4. In the left-side navigation pane, right-click the required folder and choose Create Job from the shortcut menu.
    Note You can also right-click the folder to create a subfolder, rename the folder, or delete the folder.
  5. In the dialog box that appears, set the Name and Description parameters, and select Spark Shell from the Job Type drop-down list.
    This option indicates that a Spark Shell job will be created.
  6. Click OK.
  7. Specify the command line arguments that follow the Spark Shell command in the Content field.

    Example:

    val count = sc.parallelize(1 to 100).filter { _ =>
      val x = math.random
      val y = math.random
      x*x + y*y < 1
    }.count()println(s"Pi is roughly ${4.0 * count / 100}")
  8. Click Save.