Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hive table locks

Tags:

hadoop

hive

I have hive tables which are queried through queries in a file. I had invoked an oozie workflow which invoked a hive action for mentioned file. The job did not succeed and I killed the workflow.

But the tables are still shown as locked on Hive CLI. I am looking for a command/process that will release locks from Hive tables.

like image 621
Anup Avatar asked Oct 07 '15 07:10

Anup


2 Answers

To Check the locks on table (Run in Hive)-

show locks tablename extended;

To find the activity id for long running query - (You need to pass User from above query and can verify the Agent Info from first query with the application name in below query). Run outside hive

yarn application -list | grep User

To kill the activity id -

yarn application -kill activityid

like image 199
Raghavendra Gupta Avatar answered Oct 22 '22 23:10

Raghavendra Gupta


if you use mysql as metastore, it will store table locks info in table HIVE_LOCKS, truncate it .

mysql> select * from HIVE_LOCKS;
Empty set (0.00 sec)
mysql>
like image 42
廖梓帆 Avatar answered Oct 22 '22 22:10

廖梓帆