I want to create an external Hive table from a text file containing epoch in HDFS. Let's say the file is located at the /user/me/test.txt
. Here's the file content:
1354183921
1354183922
I have Hive 0.8.1 installed and should be able to use type Timestamp, so I created the table:
hive> CREATE EXTERNAL TABLE test1 (epoch Timestamp)
LOCATION '/user/me';
Then I queried the table:
SELECT * FROM test1;
and got the following exception:
Failed with exception java.io.IOException:java.lang.IllegalArgumentException:
Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
Have I missed anything when creating the external table? I'm confused because Hive (since 0.8) supports Timestamp in the format of Unix epoch in second: https://cwiki.apache.org/Hive/languagemanual-types.html#LanguageManualTypes-Timestamps