How to concatenate two elements in pyspark RDD?
<p>I am newbie to Spark, asking a basic silly question. My data is in the format of </p>

<pre><code>[firstName1,lastName1,firstName2,lastName2,firstName3,lastName3,.....,firstNameN,lastNameN] 
</code></pre>

<p>so I have to iterate to this RDD. I have to concatenate firstName and lastName and produce an output like </p>

<pre><code>[firstName1 lastName1,firstName2 lastName2,firstName3 lastName3,.....,firstNameN lastNameN]. 
</code></pre>

<p>By applying action <code>collect()</code> on the RDD and writing python code I am able to achieve it. But as this is a huge I can't apply collect. Somehow I am not able to understand how to achieve this. </p>

<p>Any help is much appreciated</p>