1)分区测试
object partition03_file_default {
def main(args: Array[String]): Unit = {
val conf: SparkConf = new SparkConf().setMaster("local[*]").setAppName("SparkCoreTest")
val sc: SparkContext = new SparkContext(conf)
//1)默认分区的数量:默认取值为当前核数和2的最小值,一般为2
//val rdd: RDD[String] = sc.textFile("input")
rdd.saveAsTextFile("output")
sc.stop()
}
}
2)分区源码