创建分区视图时出现Hive错误

时间:2015-03-15 06:00:56

标签: apache hadoop hive hdfs hiveql

我有一个' log'当前按年,月和日划分的表。我希望在' log'之上创建一个分区视图。表但遇到此错误:

hive> CREATE VIEW log_view PARTITIONED ON (pagename,year,month,day) AS SELECT pagename, year,month,day,uid,properties FROM log; 

FAILED: SemanticException [Error 10093]: Rightmost columns in view output do not match PARTITIONED ON clause

创建分区视图的正确方法是什么?

1 个答案:

答案 0 :(得分:3)

试试这个..

 CREATE VIEW log_view PARTITIONED ON (pagename,year,month,day) AS SELECT uid,properties,pagename, year,month,day FROM log; 

原因是分区列必须在select语句查询中为最后一个。