title: Scala spark how do I sum two columns
body: <p>I have a table that looks like this:</p>
  <pre><code>+------+-----+
  |  ColA| ColB|
  +------+-----+
  |    5 |    1| 
  |    8 |    2| 
  +------+-----+
  </code></pre>
  <p>I need to add a summary column that ads the row values together like this:</p>
  <pre><code>+------+-----+-----+
  |  ColA| ColB| SUM |
  +------+-----+-----+
  |    5 |    1|    6|
  |    8 |    2|   10|
  +------+-----+-----+
  </code></pre>
  <p>Here is how I'm trying to do it:</p>
  <pre><code>var foo = df.withColumn(&quot;SUM&quot;, sum(df(&quot;ColA&quot;), df(&quot;ColB&quot;)))
  </code></pre>
  <p>But I'm getting <code>error: overloaded method value sum with alternatives:</code></p>