无法删除包含特殊字符等号(=)的配置单元表分区

toe95027  于 2021-06-27  发布在  Hive
关注(0)|答案(1)|浏览(400)

在配置单元表中插入数据,分区列(cl)值为('cl=18'),存储为/db/tbname/cl=cl%3d18(无效分区包含url编码的等号特殊字符)。
根据hortonworks社区的说法,提到hive存储特殊字符作为url转义。
我尝试将等号的转义序列用作\x3d(十六进制)、\u0030(unicode),但没有成功
例如:alter table tb drop partition(cl='cl\x3d18');<--不起作用
有人能帮帮我吗,我是不是做了什么等号的错事?

kulphzqa

kulphzqa1#

尝试 alter table id drop partition(cl="cl=18"); (或)用 single quotes(') 也。
我已经彻底地重新创建了这个场景,并且能够删除带有特殊字符的分区,而不使用任何十六进制..等序列。
例子:
我已经用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  |
+------------+--+
+------------+--+

相关问题