title: How to cast to Long in Spark Scala?
body: <p>This seems to be a simple task, but I cannot figure out how to do it with Scala in Spark (not PySpark).
  I have a DataFrame <code>df</code> with different columns. One of the columns has a type <code>String</code> that should be changed to <code>Long</code>. How can I do it?</p>
  
  <p>If I execute this code, I get the compilation error <code>Cannot resolve symbol col</code>:</p>
  
  <pre><code>df.withColumn("timestamp", col("timestamp").cast(LongType))
  </code></pre>