1、take
scala> val t = sc.parallelize(1 to 10) t: org.apache.spark.rdd.RDD[Int] = ParallelCollectionRDD[0] at parallelize at <console>:27 scala> t.take(3) res0: Array[Int] = Array(1, 2, 3)
时间: 2024-10-28 03:30:52
1、take
scala> val t = sc.parallelize(1 to 10) t: org.apache.spark.rdd.RDD[Int] = ParallelCollectionRDD[0] at parallelize at <console>:27 scala> t.take(3) res0: Array[Int] = Array(1, 2, 3)