Common Spark command line
$SPARK_HOME/bin/spark-submit
command to submit Spark driver program (application) to run on Spark cluster
$SPARK_HOME/bin/spark-submit --master spark://10.0.0.202:7077 --class org.apache.spark.examples.SparkPi $SPARK_HOME/examples/jars/spark-examples_2.11-2.4.4.jar
20/04/29 16:05:15 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Pi is roughly 3.1450957254786274
$SPARK_HOME/bin/spark-shell
Command line interface to run Scala code with Spark. It automatically creates a SparkSession called spark and SparkContext called sc after launching. To exit spark-shell, use command :quit
spark-shell
20/04/29 15:32:41 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Spark context Web UI available at http://master.hadoop.lan:4040
Spark context available as 'sc' (master = local[*], app id = local-1588199577814).
Spark session available as 'spark'.
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 2.4.4
/_/
Using Scala version 2.11.12 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_191)
Type in expressions to have them evaluated.
Type :help for more information.
scala>
$SPARK_HOME/bin/pyspark
Command line interface to run Python code with Spark, upon launching, it automatically creates SparkSession called spark and SparkContext called sc, it is Python interface, exit with quit()
$SPARK_HOME/bin/spark-sql
A SQL client used to run SQL queries against HIVE tables through HIVE thrift server.
$SPARK_HOME/bin/run-example
Run built in scala example in $SPARK_HOME/examples/src/main/scala/org/apache/spark/examples
Last updated
Was this helpful?