How to sort Array[Row] by given column index in Scala
<p>How to sort <code>Array[Row]</code> by given column index in Scala?</p>

<p>I'm using <code>RDD[Row].collect()</code> which gives me <code>array[Row]</code>, but I want to sort it based on a given column index.</p>

<p>I have already used quick-sort logic and it's working, but there are too many for loops and all.</p>

<p>I would like to use a Scala built-in API which can do this task with the minimum amount of code.</p>