title: Checking for date validity in spark sql
body: <p>Is it possible to check if a date(yyymmdd) is valid in spark SQL?
  I have tried the following:</p>
  
  <pre><code>TO_DATE(CAST(UNIX_TIMESTAMP(CAST(UNIX_TIMESTAMP(colname, 'yyyymmdd') AS  TIMESTAMP))) IS NOT NULL
  </code></pre>
  
  <p>Thanks,
  Bharath</p>