本地Mac
Spark-Shell
sc
.textFile("/Users/yangyangyang/app/spark-3.0.0-bin-hadoop3.2/bin/input/word.txt")
.flatMap(_.split(" "))
.map((_,1))
.reduceByKey(_+_)
.collect
提交任务到Spark
/Users/yangyangyang/app/spark-3.0.0-bin-hadoop3.2/bin/spark-submit
--class org.apache.spark.examples.SparkPi
--master local[2] ../examples/jars/spark-examples_2.12-3.0.0.jar 10
复制
/Users/yangyangyang/app/spark-3.0.0-bin-hadoop3.2/bin/spark-submit --class org.apache.spark.examples.SparkPi --master local[2] ../examples/jars/spark-examples_2.12-3.0.0.jar 10