如果分区列名称不正确,Hive将删除所有分区 [英] Hive drops all the partitions if the partition column name is not correct
问题描述
我正遇到一个关于蜂巢的奇怪问题, 我有一张基于dept_key分区的表(它是一个整数,例如3212) 表创建如下
I am facing a strange issue with hive, I have a table, partitioned on the basis of dept_key (its a integer eg.3212) table is created as follows
create external table dept_details (dept_key,dept_name,dept_location) PARTITIONED BY (dept_key_partition INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY '~' LOCATION '/dept_details/dept/';
现在我已经添加了一些分区,例如:1204,1203,1204
当我尝试删除分区时,我错误地只输入了dept_key
而不是"dept_key_partition"
,这反过来又删除了我所有的分区
删除查询alter table dept_details drop partition (dept_key=12)
,这是我面临的一个非常奇怪的问题.请让我知道可能是什么问题.
谢谢.
Now I have some partitions already added e.g: 1204,1203,1204
When I tried dropping the partition I by mistake typed only dept_key
and not "dept_key_partition"
this in turn dropped all my partition
drop query alter table dept_details drop partition (dept_key=12)
, its a very strange issue which I am facing. Please let me know what can be the probable issue.
Thank you.