Attempt to do update or delete using transaction m

2019-02-08 18:09发布

问题:

While trying to update a data in Hive table in Cloudera Quickstart VM, I'm getting this error.

Error while compiling statement: FAILED: SemanticException [Error 10294]: Attempt to do update or delete using transaction manager that does not support these operations.

I added some changes in hive-site.xml file and also restarted the hive and cloudera.These are changes which I made in 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

回答1:

I've tried with the configuration you provided in a hortonworks sandbox and I was able to do ACID operations on a table and I suppose it works also in Cloudera environment. Although there a some things to mention:

  • make sure hive has the properties you gave it (you can verify them in Hive CLI using SET command)
  • table that you work with must be bucketed, declared as ORC format and has in it's table properties 'transactional'='true' (hive support ACID operations only for ORC format and transactional tables). An example of a proper table is like this:

    hive>create table testTableNew(id int ,name string ) clustered by (id) into 2 buckets stored as orc TBLPROPERTIES('transactional'='true');

You can follow this example.