I have an RDD which was groupByKey as below,
(1, CompactBuffer(2.0, 3.0, 4.0)), (2, CompactBuffer(1.0, -1.0, -2.0))
And I wish to mapValues into (1*x_1^2, 2*x_2^2, 3*x_3^2)
which should look like this,
(1, CompactBuffer(4.0, 18.0, 48.0)), (2, CompactBuffer(1.0, 2.0, 12.0))
What should I do?
Thanks for your help.