[ 
https://issues.apache.org/jira/browse/SENTRY-494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14282607#comment-14282607
 ] 

Colin Ma commented on SENTRY-494:
---------------------------------

[~prasadm], I investigated the lock & unlock in hive, the transaction manager 
must be used to support lock & unlock.
for example, the code for lock table in hive:
{code}
............
private int lockTable(LockTableDesc lockTbl) throws HiveException {
    Context ctx = driverContext.getCtx();
    HiveTxnManager txnManager = ctx.getHiveTxnManager();
    if (!txnManager.supportsExplicitLock()) {
      throw new HiveException(ErrorMsg.LOCK_REQUEST_UNSUPPORTED,
          conf.getVar(HiveConf.ConfVars.HIVE_TXN_MANAGER));
    }
    HiveLockManager lockMgr = txnManager.getLockManager();
    if (lockMgr == null) {
      throw new HiveException("lock Table LockManager not specified");
    }
..........
{code}
I totally agree with you that the hive metastore schema shouldn't be hard 
coding for the test case.
In the patch 004, the hard coding is not necessary, "DummyTxnManager" and 
"EmbeddedLockManager" are used for test. There will be an exception when do the 
"unlock", but I think it's not a problem for the authorization test.   

> UNLOCK TABLE is not allowed
> ---------------------------
>
>                 Key: SENTRY-494
>                 URL: https://issues.apache.org/jira/browse/SENTRY-494
>             Project: Sentry
>          Issue Type: Bug
>    Affects Versions: 1.3.0
>         Environment: Sentry 1.3.0 CDH5.1.2
>            Reporter: Grisha Trubetskoy
>            Assignee: Colin Ma
>         Attachments: SENTRY-494.001.patch, SENTRY-494.002.patch, 
> SENTRY-494.003.patch, SENTRY-494.004.patch
>
>
> {code}
> UNLOCK TABLE grisha_test;
> Error: Error while compiling statement: FAILED: SemanticException No valid 
> privileges (state=42000,code=40000)
> {code}
> Unless I'm missing something, there is no way to specify an unlock privilege 
> in Sentry.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to