Transactions

For now, all transactions in HQL are auto-committed without supporting BEGIN, COMMIT, and ROLLBACK, like as with relational databases. Also, the table that has a transaction feature enabled has to be a bucket table with the ORC file format. The following configuration parameters must be set appropriately in hive-site.xml or beeline connection string to turn on transaction support:

> SET hive.support.concurrency = true;> SET hive.enforce.bucketing = true;> SET hive.exec.dynamic.partition.mode = nonstrict;> SET hive.txn.manager = > org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;> SET hive.compactor.initiator.on = true;> SET hive.compactor.worker.threads = 1;
When a transaction is enabled, each transaction-related operation, such ...

Get Apache Hive Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.