[
https://issues.apache.org/jira/browse/HIVE-24705?focusedWorklogId=575673&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-575673
]
ASF GitHub Bot logged work on HIVE-24705:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Apr/21 18:40
Start Date: 01/Apr/21 18:40
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_r605869332
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -13707,14 +13709,25 @@ 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;
+ 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);
+ }
+ t.setStorageHandler(storageHandler);
+ for(Map.Entry<String,String> serdeMap :
storageFormat.getSerdeProps().entrySet()){
Review comment:
Currently, in the compilation phase we are not sending serde information
for ranger auth. This storageFormat's serde has table mappings(eg: hbase table
name, column family) of external that needs to be set to table serde.
--
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 575673)
Time Spent: 50m (was: 40m)
> 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: 50m
> 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)