无法删除 Hive 表分区包含特殊字符等号 (=)


  • 在Hive表中插入的数据,分区列(CL(值为('CL=18'(,存储为/db/tbname/CL=CL%3D18(无效分区包含等号的URL编码特殊字符(。

    • 根据 hortonworks 社区,它提到 hive 存储特殊字符作为 url 转义。

      • 我尝试将等号转义序列用作 \x3D(十六进制(、\u0030(unicode(,但没有工作

例如:更改表 tb 删除分区 (CL='CL\x3D18'(; <-- 不起作用

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

尝试使用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  |
+------------+--+
+------------+--+

最新更新