title: Renaming column names of a DataFrame in Spark Scala
body: <p>I am trying to  convert all the headers / column names of a <code>DataFrame</code> in Spark-Scala. as of now I come up with following code which only replaces a single column name. </p>
  
  <pre><code>for( i &lt;- 0 to origCols.length - 1) {
    df.withColumnRenamed(
      df.columns(i), 
      df.columns(i).toLowerCase
    );
  }
  </code></pre>