Two Very Useful Hive Lock Settings

hive.lock.numretries
hive.lock.sleep.between.retries

The first property indicates the number of times the client will attempt to get a lock before it gives up. The second property indicates that time interval between retries for getting locks.

You would find yourself tweaking this to suit your needs. The default value for hive.lock.sleep.between.retries is very large. This could potentially mean that your query will be forever stuck in getting the lock if your table is being constantly hit with queries.

I generally use the following settings

SET hive.lock.numretries 100;
SET hive.lock.sleep.between.retries 1;

You can set the above in your ~/.hiverc file or you can set them whenever you open a new HIve CLI client session. The following shows description of the properties.

<property>
<name>hive.lock.numretries</name>
<value>100</value>
<description>The number of times you want to try to get all the
locks</description>
</property>

<property>
<name>hive.lock.sleep.between.retries</name>
<value>60</value>
<description>The sleep time (in seconds) between various retries</description>
</property>
 
18
Kudos
 
18
Kudos

Now read this

How to read ISO 8601

ISO 8601 is a format of expressing a date with timezone information. I used to get confused after looking at dates like “2014-10-07T16:11:24-07:00”. Ok so you can tell it is 7th October 2014 and 4:24 PM. The -07:00 tells us the timezone... Continue →