Search code examples
sqlsql-serverdatabasehive

with (nolock) in hive equivqlent to sql (nolock)


I want to execute a select query in Hive, but it took so long I decided to check my table lock status. Apparently the table has been locked by some ongoing queries.

I know in such cases SQL has with (nolock) that I can apply on a table. Is there something similar or equivalent in hive ?

  Sample sql query : select * from table a with (nolock)

  Equivalent query in hive is what I am looking for ?

Solution

  • You can control concurrency locking with hive.support.concurrency property. See: https://cwiki.apache.org/confluence/display/hive/configuration+properties#ConfigurationProperties-hive.support.concurrency

    In your case, just set it to false (true is the default) before executing the query:

    set hive.support.concurrency=false
    

    You can confirm that concurrency is turn off by looking into hive_beeline log for the following line:

    INFO  : Concurrency mode is disabled, not creating a lock manager