hive - 无法删除配置单元表分区包含特殊字符等号(=)
问题描述
在 Hive 表中插入数据,分区列 (CL) 值为 ('CL=18'),存储为 /db/tbname/CL=CL%3D18(无效分区包含 url 编码的等号特殊字符)。
根据hortonworks 社区,有人提到 hive 存储特殊字符作为 url 转义。
- 我尝试使用转义序列作为等号 \x3D(hex) , \u0030 (unicode) 但没有用
例如:alter table tb drop partition (CL='CL\x3D18'); <-- 没用
有人可以帮助我吗,我是否为 Equal(=) 符号做错了什么?
解决方案
尝试使用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 |
+------------+--+
+------------+--+
推荐阅读
- spring-boot - 将限制服务连接到 Spring Cloud 配置服务器失败
- java - 我如何循环直到我得到正确的答案?
- javascript - 在 JavaScript 中监听键盘点击的最有效方法是什么?
- delphi - 当方法具有索引枚举作为参数时,TRttiMethod.GetParameters() 不起作用
- google-app-engine - 无法从托管在 Google App Engine 中的 Express 应用访问 StockTwits API
- java - 在哪里存储 Azure 密钥保管库的密码?
- python - Gensim 的分段错误
- ssms - #SSMS 内置报告中的错误
- typescript - Typescript 和 Vue.js - 在初始化之前使用属性
- html - 如何使我的 div 布局在 4 列网格中可扩展?