Good Morning. I am doing a small example with ACID TRANSACTIONS HIVE. My environment is Oracle VM virtual Box 6.0 Hive 1.1.0-cdh5.13.0 I indicate the steps I have taken:
I create the 'scenariox2' table as follows:
I insert data correctly: INSERT INTO scenariox2 values (1, 'hello'); I make an alter table to allow transactions And I query correctly
The problem is: It doesn't let me update data. The update statement gives me the error 10294
Can anyone help me? Thank you very much for your time
Created on 10-15-2019 08:25 PM - edited 10-15-2019 08:34 PM
Change the transaction manager to org.apache.hadoop.hive.ql.lockmgr.DbTxnManager then try to run your update query.
Run this command in hive shell:
--creating hive table with transaction enabled.
CREATE TABLE table_name (
id int,
name string
)
CLUSTERED BY (id) INTO 2 BUCKETS STORED AS ORC
TBLPROPERTIES ("transactional"="true");
--changing transaction manager
set hive.txn.manager =org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
--insert data into table
insert into table_name values(1,"a"),(2,"b");
--update data in the table
update table_name set name="c" where id =1;
--delete specific id from table
delete from table_name where id=1;
Refer to this link for more details about transaction hive tables.
Created 10-23-2019 05:28 AM
Hi @Gerva,
You need to have below properties set to be able to use Hive ACID functionality:
hive>set hive.support.concurrency = true; hive>set hive.enforce.bucketing = true; hive>set hive.exec.dynamic.partition.mode = nonstrict; hive>set hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; hive>set hive.compactor.initiator.on = true; hive>set hive.compactor.worker.threads = a positive number on at least one instance of the Thrift metastore service;