Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to store date and timestamp in hive using timestamp column ?

How to store date and timestamp in hive using timestamp column ?

New Contributor

I am trying to read the date and timestamp values from the file by using the timestamp data typ in hive , but it returns NULL for date values and return the original timestamp.

 

Input date:

 

2015-01-01

2015-02-02 12:00:00.2323

2015-06-06

 

Output i get :

 

NULL

2015-02-02 12:00:00.2323
NULL

 

DDL:

 

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/'

 

Is there a way to solve the problem.