Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar
Moderator

In this video, we'll briefly discuss what is Hive locking mechanism, what are the type of locks and how they work. We will also demonstrate with the help of a query about validation on the locks and removal of obsolete Hive locks from backend.

Query used:

CREATE TABLE ABORTED_TXNS AS SELECT A.TXN_ID AS HL_TXNID FROM TXNS A , HIVE_LOCKS B WHERE A.TXN_ID=B.HL_TXNID AND A.TXN_STATE='a'; DELETE FROM HIVE_LOCKS WHERE HL_TXNID IN (SELECT HL_TXNID FROM ABORTED_TXNS);

Reference Link:

https://cwiki.apache.org/confluence/display/Hive/Locking

 

 

Open YouTube video here

1,150 Views