hive update报错Attempt to do update or delete using transaction manager

hive安装后需要修改已建的表及查询操作,在执行修改操作时遇到了如下问题。

hive> update dp set name='beijing' where id=1159;
FAILED: SemanticException [Error 10294]: Attempt to do update or delete using transaction manager that does not support these operations.

1、在hive-site.xml文件中,增加如下属性。

    hive.support.concurrency
    true
 

   
    hive.enforce.bucketing
    true
 

   
    hive.exec.dynamic.partition.mode
    nonstrict
 

 
    hive.txn.manager
    org.apache.hadoop.hive.ql.lockmgr.DbTxnManager
 

   
    hive.compactor.initiator.on
    true
 

 
    hive.compactor.worker.threads
    1
 

 
    hive.in.test
    true
 


2、重启hive服务;

3、创建表;
create table student(
  id int,
  name String,
  sex varchar(2),
  birthday varchar(10),
  major varchar(1)
)clustered by (id) into 2 buckets stored as orc TBLPROPERTIES('transactional'='true');

4、测试update,delete语句
hive> update dp set name='beijing' where id=1159;

修改成功。

参考:
开启hive数据表的update delete
http://blog.csdn.net/suijiarui/article/details/51174406
CDH版本hive增加Update、Delete支持
http://www.cnblogs.com/kekukekro/p/6340974.html
hive0.14-insert、update、delete操作测试
http://blog.csdn.net/hi_box/article/details/40820341

你可能感兴趣的:(Hive)