title: Casting STRING to DATE in Impala. (Possible bugs)
body: <p>This seems to be an interesting bug/problem I am facing. I am using Impala and HUE which comes under CDH 5.8 (Cloudera Distribution for Hadoop). </p>
  
  <p>On executing the below code</p>
  
  <pre><code>select '1709.02.02' as DateString, CAST((from_unixtime(UNIX_TIMESTAMP('1709.02.02','yyyy.MM.dd'))) as TIMESTAMP) as DateTimestamp
  </code></pre>
  
  <p>I get output as follows (which is expected)</p>
  
  <pre><code>datestring  datetimestamp
  1709.02.02  1709-02-02 00:00:00
  </code></pre>
  
  <p>But on executing the code below</p>
  
  <pre><code>select '1009.02.02' as DateString, CAST((from_unixtime(UNIX_TIMESTAMP('1009.02.02','yyyy.MM.dd'))) as TIMESTAMP) as DateTimestamp
  </code></pre>
  
  <p>The output displayed is as follows (which is not expected):</p>
  
  <pre><code>datestring  datetimestamp
  1009.02.02  NULL
  </code></pre>
  
  <p>Can someone kindly shed a light as to why this is happening and/or suggest a possible way-around?</p>
  
  <p>PS: It seems to work fine if the above query is run in Hive. But in Impala we are getting NULL values.</p>