Hive 配置单元更新查询

Hive 配置单元更新查询,hive,Hive,我已经设置了在配置单元中使用事务需要设置的所有参数 set hive.support.concurrency=true; set hive.enforce.bucketing=true; set hive.exec.dynamic.partition.mode=nonstrict; set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; set hive.compactor.initiator.on=true; s

我已经设置了在配置单元中使用事务需要设置的所有参数

set hive.support.concurrency=true;
set hive.enforce.bucketing=true;
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
set hive.compactor.initiator.on=true;
set hive.compactor.worker.threads=0;
使用以下命令创建表

CREATE TABLE Employee(Emp_id int,name string,company string,Desg string) clustered by (Emp_id) into 5 buckets stored as orc TBLPROPERTIES(‘transactional’=’true’);
INSERT INTO table Employee values(1,’Jigyasa’,’Infosys’,’Senior System Engineer’), (2,’Pooja’,’HCL’,’Consultant’), (3,’Ayush’,’Asia Tours an travels’,’Manager’), (4,’Tarun’,’Dell’,’Architect’), (5,’Namrata’,’Apolo’,’Doctor’);
使用以下命令在配置单元表中插入数据

CREATE TABLE Employee(Emp_id int,name string,company string,Desg string) clustered by (Emp_id) into 5 buckets stored as orc TBLPROPERTIES(‘transactional’=’true’);
INSERT INTO table Employee values(1,’Jigyasa’,’Infosys’,’Senior System Engineer’), (2,’Pooja’,’HCL’,’Consultant’), (3,’Ayush’,’Asia Tours an travels’,’Manager’), (4,’Tarun’,’Dell’,’Architect’), (5,’Namrata’,’Apolo’,’Doctor’);
但是在更新数据的时候

Update Employee set Company=’Ganga Ram’ where Emp_id=5;
我收到下面的错误消息

失败:SemanticException[错误10294]:尝试更新或删除不支持这些操作的unsingtransaction管理器


旧版本的Hive有一个bug,其中 设置hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;at CLI不生效

您可以通过运行“set hive.txn.manager”来检查这一点,它将打印当前值


最安全的方法是在hive site.xml中进行设置。

设置完所有这些属性后是否重新启动了配置单元?