[ https://issues.apache.org/jira/browse/HIVE-24705?focusedWorklogId=585563&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-585563 ]
ASF GitHub Bot logged work on HIVE-24705: ----------------------------------------- Author: ASF GitHub Bot Created on: 20/Apr/21 05:29 Start Date: 20/Apr/21 05:29 Worklog Time Spent: 10m Work Description: saihemanth-cloudera commented on a change in pull request #1960: URL: https://github.com/apache/hive/pull/1960#discussion_r616354694 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java ########## @@ -13707,14 +13709,27 @@ ASTNode analyzeCreateTable( /** Adds entities for create table/create view. */ private void addDbAndTabToOutputs(String[] qualifiedTabName, TableType type, - boolean isTemporary, Map<String, String> tblProps) throws SemanticException { + boolean isTemporary, Map<String, String> tblProps, StorageFormat storageFormat) throws SemanticException { Database database = getDatabase(qualifiedTabName[0]); outputs.add(new WriteEntity(database, WriteEntity.WriteType.DDL_SHARED)); Table t = new Table(qualifiedTabName[0], qualifiedTabName[1]); t.setParameters(tblProps); t.setTableType(type); t.setTemporary(isTemporary); + HiveStorageHandler storageHandler = null; + if(storageFormat.getStorageHandler() != null) { + try { + storageHandler = (HiveStorageHandler) ReflectionUtils.newInstance( + conf.getClassByName(storageFormat.getStorageHandler()), SessionState.get().getConf()); + } catch (ClassNotFoundException ex) { + System.out.println("Class not found. Storage handler will be set to null: " + ex); Review comment: Sorry, I was printing this to STDOUT for debugging during development. I forgot to change this to log before pushing. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 585563) Time Spent: 1h 20m (was: 1h 10m) > Create/Alter/Drop tables based on storage handlers in HS2 should be > authorized by Ranger/Sentry > ----------------------------------------------------------------------------------------------- > > Key: HIVE-24705 > URL: https://issues.apache.org/jira/browse/HIVE-24705 > Project: Hive > Issue Type: Improvement > Reporter: Sai Hemanth Gantasala > Assignee: Sai Hemanth Gantasala > Priority: Major > Labels: pull-request-available > Time Spent: 1h 20m > Remaining Estimate: 0h > > With doAs=false in Hive3.x, whenever a user is trying to create a table based > on storage handlers on external storage for ex: HBase table, the end user we > are seeing is hive so we cannot really enforce the condition in Apache > Ranger/Sentry on the end-user. So, we need to enforce this condition in the > hive in the event of create/alter/drop tables based on storage handlers. > Built-in hive storage handlers like HbaseStorageHandler, KafkaStorageHandler > e.t.c should implement a method getURIForAuthentication() which returns a URI > that is formed from table properties. This URI can be sent for authorization > to Ranger/Sentry. -- This message was sent by Atlassian Jira (v8.3.4#803005)