compare each value of two rdds in pyspark
<p>I have two rdd. For e.g.</p>
<pre><code>employee =    [(31, ['Raffery', 31, 'a', 'b']),
               (33, ['Jones', 33, '1', 'b']),
               (32, ['Heisenberg', 33, 'a', 'b']),
               (37, ['Robinson', 34, 'c', 'cc']),
               (38, ['Smith', 34, 'a', 'b'])]` 

department =   [[(31, ['Raffery', 31, 'c', 'b']),
                 (33, ['Jones', 33, 'a', 'b']),
                 (34, ['Heisenberg', 33, 'a', 'b'])]`
</code></pre>
<p>I want to compare the elements of the first rdd with the second one for each key:</p>
<p>The output should look like</p>
<blockquote>
<p>31 and the fault is in the e[1][2]</p>
<p>33 and the fault is in the e[1][2]</p>
</blockquote>