我有一个' 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
创建分区视图的正确方法是什么?
答案 0 :(得分:3)
试试这个..
CREATE VIEW log_view PARTITIONED ON (pagename,year,month,day) AS SELECT uid,properties,pagename, year,month,day FROM log;
原因是分区列必须在select语句查询中为最后一个。