Complete the code to create a new RDD by doubling each number.
rdd2 = rdd.[1](lambda x: x * 2)
The map transformation applies a function to each element and returns a new RDD.
Complete the code to get the total count of elements in the RDD.
total = rdd.[1]()The count action returns the number of elements in the RDD and triggers computation.
Fix the error in the code to collect all elements as a list.
elements = rdd.[1]()The collect action returns all elements from the RDD to the driver as a list.
Fill both blanks to create a filtered RDD and count its elements.
filtered = rdd.[1](lambda x: x > 10) count = filtered.[2]()
filter creates a new RDD with elements matching the condition. count returns the number of elements and triggers computation.
Fill all three blanks to create a mapped RDD, filter it, and collect the results.
mapped = rdd.[1](lambda x: x * 3) filtered = mapped.[2](lambda x: x < 20) result = filtered.[3]()
map transforms each element, filter selects elements, and collect brings the results to the driver as a list.