Spark rdd unique values across a paired rdd
<blockquote>
  <p>I have a Spark RDD of this datatype: RDD[(Int, Array[Int])])</p>
  
  <p>Sample values of that RDD are:</p>
  
  <p>100, Array(1,2,3,4,5)</p>
  
  <p>200,Array(1,2,50,20)</p>
  
  <p>300, Array(30,2,400,1)</p>
  
  <p>I would like to get all the unique values among all the Array elements
  of this RDD I don't care about the key, just want to get all the
  unique values. So the result from the above sample is
  (1,2,3,4,5,20,30,50,400). </p>
  
  <p>What will be an efficient way to do that.</p>
</blockquote>