importorg.apache.log4j.{Level,Logger}importorg.apache.spark.rdd.RDD
importorg.apache.spark.{SparkConf,SparkContext}
object RDDdEMO{Logger.getLogger("org").setLevel(Level.ERROR)
def main(args:Array[String]):Unit={
val conf:SparkConf=newSparkConf().setMaster("local[4]").setAppName(this.getClass.getSimpleName)
val sc=newSparkContext(conf)
val arr:Array[Int]=Array(1,2,3,4)
val mp:Map[String,Int]=Map[String,Int](("wnn",10),("cc",11))
val rdd1: RDD[Int]=sc.parallelize(arr,4)
val rdd2: RDD[(String,Int)]=sc.parallelize(mp.toList,16)
val size1:Int=rdd1.partitions.size
println(size1)
val size2:Int=rdd2.partitions.size
println(size2)
sc.stop()}}