title: How to sort RDD
body: <p>I have scoreTriplets is RDD[ARRAY[String]] which I am sorting by following way.</p>
  
  <pre><code>var ScoreTripletsArray = scoreTriplets.collect()
    if (ScoreTripletsArray.size &gt; 0) {        
      /*Sort the ScoreTripletsArray descending by score field*/        
      scala.util.Sorting.stableSort(ScoreTripletsArray, (e1: Array[String], e2: Array[String]) =&gt; e1(3).toInt &gt; e2(3).toInt)
  }
  </code></pre>
  
  <p>But collect() will be heavy If there is elements in lack.   </p>
  
  <p>So I need to sort RDD by <code>score</code> without using collect().<br>
  scoreTriples is RDD[ARRAY[String]] each line of RDD will store Array of the below variables.<br>
  EdgeId sourceID destID <code>score</code> sourceNAme destNAme distance  </p>
  
  <p>Please give me any reference or hint. </p>