You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/05/17 23:08:04 UTC

[GitHub] [hive] saihemanth-cloudera commented on a diff in pull request #3247: HIVE-26055: Added the right HivePrivilegesObjects for Alter table ren…

saihemanth-cloudera commented on code in PR #3247:
URL: https://github.com/apache/hive/pull/3247#discussion_r875334956


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/rename/AbstractAlterTableRenameAnalyzer.java:
##########
@@ -48,7 +54,12 @@ protected void analyzeCommand(TableName tableName, Map<String, String> partition
     if (AcidUtils.isTransactionalTable(table)) {
       setAcidDdlDesc(desc);
     }
-    addInputsOutputsAlterTable(tableName, null, desc, desc.getType(), false);

Review Comment:
   I tried to implement essential logic in that method here which is organizing input and output object lists. But I now added back the method and added the output list in a way that we would need it in Apache Ranger.



##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLAuthorizationUtils.java:
##########
@@ -269,7 +269,19 @@ 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 {
+          isTableExists = metastoreClient.tableExists(hivePrivObject.getDbname(), hivePrivObject.getObjectName());

Review Comment:
   Ack



##########
itests/util/src/main/java/org/apache/hadoop/hive/ql/hooks/VerifyOutputTableLocationSchemeIsFileHook.java:
##########
@@ -24,10 +24,10 @@ public class VerifyOutputTableLocationSchemeIsFileHook implements ExecuteWithHoo
 
   @Override
   public void run(HookContext hookContext) {
-    for (WriteEntity output : hookContext.getOutputs()) {
-      if (output.getType() == WriteEntity.Type.TABLE) {
-        String scheme = output.getTable().getDataLocation().toUri().getScheme();
-        Assert.assertTrue(output.getTable().getTableName() + " has a location which has a " +
+    for (ReadEntity input : hookContext.getInputs()) {

Review Comment:
   Yeah, this change is an intended one. This class is only used in rename_table_location.q file and it is used  to verify the table object and its location. Previously, output and input had the old table objects for authorization. Now, we would like to have the old table in the input list and the new database and table object in the output list.



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org