szehon-ho commented on issue #2301:
URL: https://github.com/apache/iceberg/issues/2301#issuecomment-926820596


   I found it useful to have a small script to unlock manually as well (in case 
the HMS thread is not configured).  In scala for instance assuming you get a 
hmsclient:
   
   ```
    def unlock(db: String, table: String): Unit = {
       val lockIds = getLockIds(db, table)
       lockIds.foreach{
         hmsClient.unlock(_)
       }
     }
   
     private def getLockIds(db: String, table: String): Set[Long] = {
       val showLockRequest = new ShowLocksRequest()
       showLockRequest.setDbname(db)
       showLockRequest.setTablename(table)
       showLockRequest.setIsExtended(true)
       val response = hmsClient.showLocks(showLockRequest)
       val locks = response.getLocks.asScala
       locks.map(_.getLockid).toSet
     }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to