Complete the code to create an RDD from a list in Spark.
rdd = sparkContext.[1]([1, 2, 3, 4])
The parallelize method creates an RDD from a local collection like a list.
Complete the code to apply a transformation that doubles each number in the RDD.
doubled_rdd = rdd.[1](lambda x: x * 2)
The map transformation applies a function to each element in the RDD.
Fix the error in the code to collect the results from the RDD.
results = rdd.[1]()The collect action returns all elements of the RDD to the driver as a list.
Fill both blanks to create an RDD and filter out numbers less than 5.
filtered_rdd = sparkContext.[1]([3, 6, 1, 8]).[2](lambda x: x >= 5)
First, parallelize creates the RDD. Then, filter keeps only numbers 5 or greater.
Fill all three blanks to create an RDD, transform it by adding 10, and collect the results.
result = sparkContext.[1]([1, 2, 3]).[2](lambda x: x + 10).[3]()
First, parallelize creates the RDD. Then, map adds 10 to each element. Finally, collect gathers the results to the driver.