简体   繁体   中英

How to enable timestamp in Hive

After logging in to hive I get the following.

sudo -u hdfs hive
[warnings and information about deprecated configurations]
Logging initialized using configuration in jar:file:/opt/cloudera/parcels/CDH-5.0.0-1.cdh5.0.0.p0.47/lib/hive/lib/hive-common-0.12.0-cdh5.0.0.jar!/hive-log4j.properties

When I create a table in Hive with a timestamp data type I get the following.

hive> create table rts(usergender string, usercity string, usersentiment int, zipcode string, sku string, createdat timestamp, category string, price float, county string, countycode string, userstate string, categorygroup string) partitioned by (createdat_hour bigint) stored as parquet;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.UnsupportedOperationException: timestamp not implemented yet

Hive timestamp is available after Hive 0.8 version.

Looks like you are using CDH 5 which comes with above Hive 0.10 . I don't see any kind of problems other than version type. Check your Hive version once.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM