這是我的腳本:蜂巢,桶裝的分區表
--table without partition
drop table if exists ufodata;
create table ufodata (sighted string, reported string, city string, shape string, duration string, description string)
row format delimited
fields terminated by '\t'
Location '/mapreduce/hive/ufo';
--load my data in ufodata
load data local inpath '/home/training/downloads/ufo_awesome.tsv' into table ufodata;
--create partition table
drop table if exists partufo;
create table partufo (sighted string, reported string, city string, shape string, duration string, description string)
partitioned by (year string)
clustered by (year) into 6 buckets
row format delimited
fields terminated by '/t';
--by default dynamic partition is not set
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
--by default bucketing is false
set hive.enforcebucketing=true;
--loading mydata
insert overwrite table partufo
partition (year)
select sighted, reported, city, shape, min, description, SUBSTR(TRIM(sighted), 1,4) from ufodata;
錯誤消息:
失敗:錯誤的語義分析:無效的列引用
我試過了瓢潑大雨爲我的分區表。如果我刪除「由(年)聚集成6桶」的腳本工作正常。如何分區分區表
Puneeth的語法也差不多...... – madhu
那麼這個腳本有什麼問題呢?我可以在分區表上創建分區嗎?腳本:gist.github.com/puneethbs/207dc89530c26c05ed02錯誤消息:gist.github.com/puneethbs/3dcdebb4075275bbf62b – Puneeth