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/07/28 16:38:38 UTC

[GitHub] [hive] deniskuzZ commented on a diff in pull request #3482: HIVE-26433: StorageHandler authorization doesn't work with "METASTORE" db type

deniskuzZ commented on code in PR #3482:
URL: https://github.com/apache/hive/pull/3482#discussion_r932459551


##########
jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/JdbcStorageHandler.java:
##########
@@ -99,7 +101,10 @@ public void configureInputJobProperties(TableDesc tableDesc, Map<String, String>
   @Override
   public URI getURIForAuth(Table table) throws URISyntaxException {
     Map<String, String> tableProperties = HiveCustomStorageHandlerUtils.getTableProperties(table);
-    String host_url = tableProperties.get(Constants.JDBC_URL);
+    DatabaseType dbType = DatabaseType.valueOf(
+      tableProperties.get(JdbcStorageConfig.DATABASE_TYPE.getPropertyName()));
+    String host_url = DatabaseType.METASTORE == dbType ?
+      "internal:metastore://" : tableProperties.get(Constants.JDBC_URL);

Review Comment:
   With the current setup
   ````
   'HivePrivilegeObject':{'type':STORAGEHANDLER_URI, 'dbName':null, 'objectType':STORAGEHANDLER_URI, 'objectName':internal:metastore:///null, 'columns':[], 'partKeys':[], 'commandParams':[], 'actionType':OTHER, 'owner':hive}
   ````
   elements={storage-type=internal:metastore; storage-url=/null; }
   
   Why do we need to remove extra "/" after "metastore?



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