As long as the function that you are mapping over the RDD is pure,
preserving referential transparency so that anytime you map the same
function over the same initial RDD elements you get the same result
elements, then there is no problem in doing what you suggest.  In fact,
it's common practice.


On Mon, Apr 21, 2014 at 6:33 PM, Ian Ferreira <ianferre...@hotmail.com>wrote:

> Feels like a silly questions,
>
> But what if I wanted to apply a map to each element in a RDD, but instead
> of replacing it, I wanted to add new columns of the manipulate value
>
> I.e.
>
> res0: Array[String] = Array(1 2, 1 3, 1 4, 2 1, 3 1, 4 1)
>
>
> Becomes
>
>
> res0: Array[String] = Array(1 2 *2 4*, 1 3 1 6, 1 4 1 8, 2 1 4 2, 3 1 6
> 2, 4 1 8 2)
>
>
> Cheers
>
> - Ian
>

Reply via email to