title: How to store date value in hive timestamp?
body: <p>I am trying to store the date and timestamp values in timestamp column using hive. The source file contain the values of date or sometimes timestamps.</p>
  
  <p>Is there a way to read both date and timestamp by using the timestamp data type in hive.</p>
  
  <p><strong>Input:</strong></p>
  
  <pre><code>2015-01-01  
  2015-10-10 12:00:00.232
  2016-02-01
  </code></pre>
  
  <p><strong>Output which I am getting:</strong></p>
  
  <pre><code>  null
    2015-10-10 12:00:00.232
    null
  </code></pre>
  
  <p>Is it possible to read both values by using timestamp data type.</p>
  
  <p><strong>DDL:</strong></p>
  
  <pre><code>create external table mytime(id string ,t timestamp) ROW FORMAT DELIMITED
    FIELDS TERMINATED BY ','
  STORED AS INPUTFORMAT
    'org.apache.hadoop.mapred.TextInputFormat'
  OUTPUTFORMAT
    'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
  LOCATION 'hdfs://xxx/data/dev/ind/'
  </code></pre>