Submitting Statements
Describes how to submit statements in HPE Ezmeral Unified Analytics Software.
Prerequisites
- Create an interactive session. See Creating Interactive Sessions.
About this task
Run statements in Python, R, or Scala.
Procedure
-
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.
-
Select either Python, R, or Scala as the statements' programming
language.
-
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);
-
Click the Run icon on the top right of the
Statements pane.
For example: Running the previous statement returns the following statement result:NOTEEach Spark interactive session expires in 60 minutes.