Hive中如何启用时间戳



登录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

当我在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

Hive时间戳在Hive 0.8版本之后可用。

看起来你正在使用Hive 0.10以上的CDH 5。除了版本类型,我没有看到任何问题。检查一次Hive版本

最新更新