Last active
August 29, 2015 14:14
-
-
Save mwinkle/11dc1cecdf27fad05863 to your computer and use it in GitHub Desktop.
Transactional Hive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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