首页 > 代码库 > scala 常用方法

scala 常用方法

 

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)

 

scala 常用方法