in scala,how to get the collect the values in Iterable[(Tuple)]
<p>I have an <code>RDD[(Key,Iterable[(Name,Value)])]</code>.
I am trying to get all the values in <code>Name</code> so that I can get all the unique occurrences of <code>Name</code> and then create an <code>Index</code> so I can create a resulting <code>RDD</code> of <code>RDD[(Key,Iterable[(Index,Value)])]</code>.</p>

<p>Input examples: </p>

<pre><code>(4048,CompactBuffer(("a",3.0), ("b",9.0), ("c",14.0))
(4049,CompactBuffer(("a",2.0), ("c",14.0))
(4050,CompactBuffer(("b",2.0), ("d",10.0))
</code></pre>

<p>Output examples: </p>

<pre><code>(4048,CompactBuffer((1,3.0), (2,9.0), (3,14.0))
(4049,CompactBuffer((1,2.0), (3,12.0))
(4050,CompactBuffer((2,2.0), (4,10.0))
</code></pre>