返回RDD中的item数
注:这是一个action操作,会触发实际计算
函数原型:
def count(): Long
例子:
val c = sc.parallelize(List("Gnu", "Cat", "Rat", "Dog"), 2) c.count res2: Long = 4