Spark: FlatMapValues query
<p>I'm reading the Learning Spark book and couldn't understand the following pair rdd transformation.</p>

<pre><code>rdd.flatMapValues(x =&gt; (x to 5))
</code></pre>

<p>It is applied on an rdd <code>{(1,2),(3,4),(3,6)}</code> and the output of the transformation is <code>{(1,2),(1,3),(1,4),(1,5),(3,4),(3,5)}</code></p>

<p>Can someone please explain this.</p>