如何在Hive中启用时间戳

时间:2014-07-27 16:23:33

标签: hadoop timestamp hive cloudera create-table

登录到hive后,我得到以下内容。

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

当我使用 timestamp 数据类型在Hive中创建表时,我得到以下内容。

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

1 个答案:

答案 0 :(得分:1)

Hive 0.8版本后可以使用Hive时间戳。

看起来您正在使用上面的Hive 0.10附带的CDH 5。我没有看到版本类型以外的任何问题。检查您的Hive版本一次。