January 2019
Beginner to intermediate
154 pages
4h 31m
English
An RDD can be created in four ways:
#PythonnumberRDD = spark.sparkContext.parallelize(range(1,10))numberRDD.collect()Out[4]: [1, 2, 3, 4, 5, 6, 7, 8, 9]
The following code performs the same operation in Scala:
//scalaval numberRDD = spark.sparkContext.parallelize(1 to 10)numberRDD.collect()res4: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)