title: how to convert current_timestamp() value in to a string in scala
body: <p>I have been trying to add a timestamp to my data frames and persist them in to hive.</p>
  
  <p>But here is the problem: as I cannot use timestamps as a data type in hive version 0.13 I want to convert <code>current_timestamp()</code> of the timestamp data type to string so that I can load it in to my hive table.</p>
  
  <p>Here is my timestamp column:</p>
  
  <pre><code>[2017-01-12 12:55:55.278] [2017-01-12 12:55:55.278] [2017-01-12 12:55:55.278] [2017-01-12 12:55:55.278] [2017-01-12 12:55:55.278]
  </code></pre>
  
  <p>I have tried this but with no luck:</p>
  
  <pre><code> val ts = current_timestamp()
      val df:SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd")
      val date:String = df.format(ts.toLong)
  </code></pre>
  
  <p>Any way to convert the timestamp to string in Scala??</p>