Created on 12-07-202010:17 PM - edited on 12-21-202011:36 PM by VidyaSargur
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);