In order to use ACID transactions in Hive 2 on MR3, the user should initialize the database schema when running Metastore for the first time (e.g., by executing hive/metastore-service.sh with --init-schema). Then the user can enable ACID transactions by providing additional configuration settings for Metastore and HiveServer2.

Here is an example of configuring Metastore for enabling ACID transactions:

  • set hive.compactor.initiator.on to true.
  • set hive.compactor.worker.threads to an integer greater than 0.

Here is an example of configuring HiveServer2 or HiveCLI for enabling ACID transactions:

  • set hive.support.concurrency to true.
  • set hive.enforce.bucketing to true (which is unnecessary for Hive 2 and 3).
  • set hive.exec.dynamic.partition.mode to nonstrict.
  • set hive.txn.manager to org.apache.hadoop.hive.ql.lockmgr.DbTxnManager.