Two Very Useful Hive Lock Settings


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.

<description>The number of times you want to try to get all the

<description>The sleep time (in seconds) between various retries</description>

Now read this

Create a file of size x bytes

One of the common requirements I run across in moving data around is finding if I’m doing it the fastest way possible. A good indicator of speed is to find out how long it takes for a large file to get copied from one server to another.... Continue →