Java:
SparkConf conf = new SparkConf().setAppName(“para”).setMaster(“local[*]”);
JavaSparkContext sc = new JavaSparkContext(conf);
Scala:
val conf = new SparkConf().setMaster(“local[*]”).setAppName(“parallelize”)
val sc = new SparkContext(conf)
//写的时候new后面.var!!!
Spark:
val spark = SparkSession.builder().appName(“1”).master(“local[*]”).getOrCreate()
val sc = spark.sparkContext
import spark.implicits._
//不用写new 不用装参数