title: How to represent a column name with a variable in orderBy of scala dataframe?
body: <pre><code> for (e &lt;- arr02) {
        val df = t04.select("session_id", e)  // right
        val w = Window.partitionBy($"session_id").orderBy($e.desc)  //error
  }
  </code></pre>
  
  <p>e is a string variable, the method <code>.orderBy($e.desc)</code>  <code>e</code> is wrong, <code>.orderBy($"column_name".desc)</code> is right.</p>
  
  <p>Then how can I represent a column name with a variable in <code>orderBy</code>?</p>