首页 > 解决方案 > 无法删除配置单元表分区包含特殊字符等号(=)

问题描述

例如:alter table tb drop partition (CL='CL\x3D18'); <-- 没用

有人可以帮助我吗,我是否为 Equal(=) 符号做错了什么?

标签: hivespecial-charactershive-partitions

解决方案


尝试使用alter table id drop partition(cl="cl=18");(or) 也将分区值括起来single quotes(')

我已经重新创建了场景,并且能够在不使用任何 hex..etc 序列的情况下删除带有特殊字符的分区。

例子:

我已经创建了 cl 作为分区列string类型的分区表。

hive> alter table t1 add partition(cl="cl=18"); --add the partition to the table
hive> show partitions t1; --list the partititons in the table
+-------------+--+
|  partition  |
+-------------+--+
| cl=cl%3D18  |
+-------------+--+
hive>  alter table t1  drop partition(cl='cl=18'); --drop the partition from the table.
hive>  show partitions t1; 
+------------+--+
| partition  |
+------------+--+
+------------+--+

推荐阅读