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
Earlier, there was no operation supported for the deletion and updatE of a particular record in Hive. But since updating of Hive 0.14, these operations are possible to make changes in a Hive table.
You use the UPDATE statement to modify data already stored in an Apache Hive table. You construct an UPDATE statement using the following syntax: UPDATE tablename SET column = value [, column = value ...]
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With