RDD operation in pyspark
<p>I have two RDD's</p>

<pre><code>x = [("XYZ",12),("ABC",15),("PQR",20)]
y = [("XY",100),("AB",200),("PQR",123),("MNO",111)]
</code></pre>

<p>I need final result such as "XY" is sub string of "XYZ", so I want to merge this two tuple into one. Result for above example is as follow, </p>

<pre><code>result = [("XYZ",12,100),("ABC",15,200),("PQR",20,123)]
</code></pre>

<p>Right now I have achieved this using for loop. 
is there any better way to solve this ? </p>