hive分桶事务表Demo

hive会话中设置如下

SET hive.support.concurrency=true;
SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
SET hive.enforce.bucketing=true;
SET hive.exec.dynamic.partition.mode=nostrict;

事务表只支持分桶orc表

CREATE TABLE hive_acid_demo (key int, value int)
CLUSTERED BY(key) INTO 3 BUCKETS
STORED AS ORC
TBLPROPERTIES ('transactional'='true');

接下来就可以进行更新 / 删除了

http://dwgeek.com/apache-hive-table-update-using-acid-transactions-and-examples.html/

你可能感兴趣的:(hive分桶事务表Demo)