hive - 在 HIVE 中删除酸表失败
问题描述
我试图在 HIVE 中删除一个酸表,它会引发如下错误:
无法获取表:java.lang.Exception:ErrorCode:InternalError,消息:未启用酸表
DDL:</p>
create table `test`( `id` string, `c1` string )
PARTITIONED BY (created_date date) CLUSTERED BY(id) INTO 6 BUCKETS
STORED AS ORC TBLPROPERTIES (
'orc.compress'='ZLIB',
'transactional'='true' );
那么我怎样才能放下这张桌子呢?
解决方案
在使用此类表之前,您需要正确设置 hive 事务管理器。请在您的 SQL 之前运行此命令以使用 ACID 表。
SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
我使用的 SQL 如下 -
create table test( id string, c1 string ) PARTITIONED BY (created_date date)
CLUSTERED BY(id) INTO 6 BUCKETS STORED AS ORC TBLPROPERTIES ( 'orc.compress'='ZLIB', 'transactional'='true' );
SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
insert into test partition(created_date) select 'a','b',current_date();
select * from test;
对于永久修复,您需要将以下条目添加到 hive-site.xml 文件。
SET hive.support.concurrency=true;
SET hive.enforce.bucketing=true;
SET hive.exec.dynamic.partition.mode=nonstrict;
推荐阅读
- hibernate - How to transform to Map
in Hibernate? - c++ - 为什么它没有进入 if 条件?
- python - 从当前位置的模块导入自定义类时出错
- go - 恐慌:运行时错误:无效的内存地址或 nil 指针取消引用 || r.body模型
- pandas - 在 groupby 之后获取与另一列中的值相对应的一列中的值
- class - Dart class StringBuffer string.contains error
- java - 自定义对话框不再显示
- docker - 等待 apiserver:等待条件超时[kubernetes]
- z3 - z3 求解器中的存在限定符产生违反直觉的结果
- php - 如何使用 php 在不同的 html 页面中打开搜索结果