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 2021/10/13 18:27:42 UTC

[GitHub] [hive] pvary commented on a change in pull request #2714: Change authz API to use the HMS table object

pvary commented on a change in pull request #2714:
URL: https://github.com/apache/hive/pull/2714#discussion_r727955388



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizerV2.java
##########
@@ -201,17 +196,15 @@ private static void addHivePrivObject(Entity privObject, Map<String, List<String
                 hiveOpType == HiveOperationType.ALTERTABLE_PROPERTIES ||
                 hiveOpType == HiveOperationType.CREATETABLE_AS_SELECT) {
           String storageuri = null;
-          Map<String, String> tableProperties = new HashMap<>();
           Configuration conf = new Configuration();
-          tableProperties.putAll(table.getSd().getSerdeInfo().getParameters());
-          tableProperties.putAll(table.getParameters());
           try {
             if (table.getStorageHandler() instanceof HiveStorageAuthorizationHandler) {
               HiveStorageAuthorizationHandler authorizationHandler = (HiveStorageAuthorizationHandler) ReflectionUtils.newInstance(
                       conf.getClassByName(table.getStorageHandler().getClass().getName()), SessionState.get().getConf());
-              storageuri = authorizationHandler.getURIForAuth(tableProperties).toString();
+              storageuri = authorizationHandler.getURIForAuth(table.getTTable()).toString();
             } else {
               //Custom storage handler that has not implemented the HiveStorageAuthorizationHandler
+              Map<String, String> tableProperties = HiveCustomStorageHandlerUtils.getTableProperties(table.getTTable());

Review comment:
       Why not use a default implementation here.




-- 
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