create table lk3 (id string,nname string,grade int,goldUser int); insert into lk3 values (1,‘jack‘,300, 10 ), (2,‘mach‘, 200, 10 ), (3,‘lich‘, 100 ,10 ), (4,‘rock‘, 1, 0 ), (5,‘mick‘, 1 ,10 ), (6,‘kight‘, 0 ,10 ), (7,‘babaya‘, 0, 0 ), (8,‘kano‘, 0, 10);
0: jdbc:hive2://localhost:10000> update lk3 set name=‘wangqingbin‘ where id=‘1‘; Error: Error while compiling statement: FAILED: SemanticException [Error 10294]: Attempt to do update or delete using transaction manager that does not support these operations. (state=42000,code=10294)
1.在hive-site.xml文件中,增加如下属性。 <name>hive.support.concurrency</name> <value>true</value> <name>hive.enforce.bucketing</name> <value>true</value> <name>hive.exec.dynamic.partition.mode</name> <value>nonstrict</value> <name>hive.txn.manager</name> <value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value> <name>hive.compactor.initiator.on</name> <value>true</value> <name>hive.compactor.worker.threads</name> <value>1</value> <name>hive.in.test</name> <value>true</value> 2、重启hive服务;
update 和 delete都属于事物操作。
hive的行级修改 需要开启事物。
原文地址:https://www.cnblogs.com/wqbin/p/10290039.html
时间: 2024-11-04 15:04:52