Submitting Statements

Describes how to submit statements in HPE Ezmeral Unified Analytics Software.

Prerequisites

About this task

Run statements in Python, R, or Scala.

Procedure

  1. To submit statements, you can choose one of the following options:
    • Click Session ID of your Spark interactive ession.
    • Click the menu icon in the Actions column and click Open.


  2. Select either Python, R, or Scala as the statements' programming language.


  3. Enter statements in Python, R, or Scala.
    For example: Select Scala as programming language and calculate the value of Pi by running the following statement.
    val NUM_SAMPLES = 10000;
    val res = sc.parallelize(1 to NUM_SAMPLES).map { i => val x = Math.random();
    val y = Math.random();
    if (x*x + y*y < 1) 1 else 0 }.reduce(_ + _);
    println("Pi is roughly " + 4.0 * res / NUM_SAMPLES);
  4. Click the Run icon on the top right of the Statements pane.
    For example: Running the previous statement returns the following statement result:

    NOTE
    Each Spark interactive session expires in 60 minutes.