Skip to content

Instantly share code, notes, and snippets.

@mwinkle
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwinkle/11dc1cecdf27fad05863 to your computer and use it in GitHub Desktop.
Save mwinkle/11dc1cecdf27fad05863 to your computer and use it in GitHub Desktop.
Transactional Hive
set hive.support.concurrency=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=2 ;
CREATE TABLE AcidTest (name string, num int) clustered by (num) into 2 buckets STORED AS orc TBLPROPERTIES('transactional'='true');
INSERT INTO TABLE AcidTest VALUES ('one',1), ('two',2),('three',3),('four',4);
UPDATE AcidTest SET name = 'dave' WHERE num > 2;
DELETE FROM AcidTest WHERE num < 2;
SELECT * FROM AcidTest;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment