本文介绍了如何更新/删除一个蜂巢分区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 Hive 中向外部表格添加分区之后,我如何更新/放弃它?
ALTER TABLE logs PARTITION (year = 2012,month = 12,day = 18)
SET LOCATION'hdfs:// user / darcy / logs / 2012/12/18';
该命令不移动旧数据,也不删除旧数据。它只是将分区设置到新位置。
要删除分区,您可以执行
ALTER TABLE日志DROP IF EXISTS PARTITION(year = 2012,month = 12,day = 18);
希望它有帮助!
After adding a partition to an external table in Hive, how can I update/drop it?
解决方案
You can update a Hive partition by, for example:
ALTER TABLE logs PARTITION(year = 2012, month = 12, day = 18)
SET LOCATION 'hdfs://user/darcy/logs/2012/12/18';
This command does not move the old data, nor does it delete the old data. It simply sets the partition to the new location.
To drop a partition, you can do
ALTER TABLE logs DROP IF EXISTS PARTITION(year = 2012, month = 12, day = 18);
Hope it helps!
这篇关于如何更新/删除一个蜂巢分区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-17 06:30