Friday, 9 June 2017

How to Enable Transactions in Hive

Hive supports transactions by setting the correct parameters. To enable transactions, the following configurations need to be set. These configuration parameters must be set appropriately to turn on transaction support in Hive:

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 on one instance of the Thrift metastore service

hive.compactor.worker.threads - 10 for an instance of the Thrift metastore service



Use this specific table format:

CREATE TABLE mytable (
 c1 int,
 c2 string,
 c3 string
)
CLUSTERED BY (c1) INTO x BUCKETS
STORED AS orc
TBLPROPERTIES('transactional' = 'true');



Share this article with your friends.
Related Posts Plugin for WordPress, Blogger...