Scala Spark DataFrame.selectExpr throws excepton org.apache.spark.sql.AnalysisException: cannot resolve 'name' given input columns
<p>I have a DataFrame (df) that I need to add some transformed columns into it.  The original columns are "name, address" and the transformed columns are substr of name as subName and substr of address of subAdd.  I combined these two sets of column together and pass the entire list to:</p>

<pre><code>     df.selectExpr(allColumnsList)
</code></pre>

<p>However I got the exception:</p>

<pre><code>org.apache.spark.sql.AnalysisException: cannot resolve 'name' given input columns  
</code></pre>

<p>If I removed the "name" column from the schema, then the same exception was thrown on "address" column.  I wonder if this is because I changed the original DataFrame (df) by adding the transformed columns to it.  Anyone know why I am getting the exception ?</p>