[ 
https://issues.apache.org/jira/browse/HIVE-26055?focusedWorklogId=773424&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-773424
 ]

ASF GitHub Bot logged work on HIVE-26055:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/May/22 10:59
            Start Date: 23/May/22 10:59
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk commented on code in PR #3247:
URL: https://github.com/apache/hive/pull/3247#discussion_r879312194


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/rename/AbstractAlterTableRenameAnalyzer.java:
##########
@@ -49,6 +55,13 @@ protected void analyzeCommand(TableName tableName, 
Map<String, String> partition
       setAcidDdlDesc(desc);
     }
     addInputsOutputsAlterTable(tableName, null, desc, desc.getType(), false);
+//    inputs.add(new ReadEntity(table));
+    outputs.clear();

Review Comment:
   doing `outputs.clear()` right after `addInputsOutputsAlterTable` is pretty 
strange
   
   could you please put this code into that method - isn't there where it 
supposed to live?
   
   



##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLAuthorizationUtils.java:
##########
@@ -271,7 +271,16 @@ private static boolean isOwner(IMetaStoreClient 
metastoreClient, String userName
         thriftTableObj = metastoreClient.getTable(hivePrivObject.getDbname(),
             hivePrivObject.getObjectName());
       } catch (Exception e) {
-        throwGetObjErr(e, hivePrivObject);
+        boolean isTableExists = true;
+        try {
+          if(!metastoreClient.tableExists(hivePrivObject.getDbname(), 
hivePrivObject.getObjectName())) {

Review Comment:
   it would be better to place this check at the call site-s to this method - 
so that the explanation will not be needed at all



##########
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java:
##########
@@ -3612,8 +3612,8 @@ private void testRenameTable(boolean blocking) throws 
Exception {
       txnMgr2.acquireLocks(driver2.getPlan(), ctx, null, false);
       locks = getLocks();
 
-      ShowLocksResponseElement checkLock = checkLock(LockType.EXCLUSIVE,
-        LockState.WAITING, "default", "tab_acid", null, locks);
+      ShowLocksResponseElement checkLock = checkLock(LockType.SHARED_READ,

Review Comment:
   Why we don't need an exclusive lock during a rename?
   
   * what if we are reading data from a table in some dag
   * in the meantime someone renames the table
   
   with `SHARED_READ` the table will be renamed instantly - which will cause 
the dag to fail; or not?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 773424)
    Time Spent: 40m  (was: 0.5h)

> Fix the HivePrivilegesObjects for Alter table rename command
> ------------------------------------------------------------
>
>                 Key: HIVE-26055
>                 URL: https://issues.apache.org/jira/browse/HIVE-26055
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2, Security
>            Reporter: Sai Hemanth Gantasala
>            Assignee: Sai Hemanth Gantasala
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Fix the HivePrivilegeObjects for Alter table rename query in a way that it 
> includes source table information in the output objects and destination table 
> information in the input objects.
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to