Question: What needs to be added to the code to return a new RDD with all keys where the absolute difference between their keys and values
What needs to be added to the code to return a new RDD with all keys where the absolute difference between their keys and values is greater than
rdd scparallelize
# The results need to be a list of keys. In this case result
A
rdd rddmaplambda x: x absx xfilterlambda x: xmaplambda x: x
B
rdd rddmaplambda x: x x xfilterlambda x: xmaplambda x: x
C
rdd rddflatMaplambda x: x i for i in xfilterlambda x: absx xmaplambda x: xxreduceByKeylambda x y: x yflatMaplambda x: x i for i in x
D
rdd rddmaplambda x: x x xfilterlambda x: xmaplambda x: x
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
