3
votes

I'm using hive to create and try to load file content into the table. There's a column type "Date" and the date format in the file is dd/mm/yy, for example: 01/12/2013

But when I trie to load the data into table from the file, the column values corresponding to the "Date" is always NULL, as if failed to load the date content.

I put the column content into a txt file and upload to the hdfs, so, the column may be: id, name, birthdate

and corresponding value are: 1, "Joan", 04/05/1989

But the "04/05/1989" seems can't be read into the table, always null.

Please tell me if the format in my txt file is wrong or I need some specific grammar when loading date type data into Hive table.

Thanks!

1

1 Answers

6
votes

Date data type format is YYYY-MM-DD. You need to format field accordingly.

More details on

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-date