title: Adding 12 hours to datetime column in Spark
body: <p>I have tried to search quite a bit, but could only found add_month function in Spark SQL, so ending up opening a new thread here. Would appreciate any help someone could offer.</p>
  
  <p>I am trying to add hours 12, 24, and 48 to a date column in Spark SQL using sqlContext. I am using 1.6.1 version of Spark and I need something like this:</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT N1.subject_id, '12-HOUR' AS notes_period, N1.chartdate_start, N2.chartdate, N2.text
  FROM NOTEEVENTS N2,
  (SELECT subject_id, MIN(chartdate) chartdate_start
    FROM NOTEEVENTS
    WHERE subject_id = 283
    AND category != 'Discharge summary'
  GROUP BY subject_id) N1
  WHERE N2.subject_id = N1.subject_id
  and n2.chartdate &lt; n1.chartdate_start + interval '1 hour' * 12
  </code></pre>
  
  <p>Please notice the last clause, which is written in PostgreSql, and is what I need in Spark SQL. I'd really appreciate any help I could get.</p>
  
  <p>Thanks.</p>