Sam An created HIVE-22961: ----------------------------- Summary: Drop function in Hive should not send request for drop database to Ranger plugin. Key: HIVE-22961 URL: https://issues.apache.org/jira/browse/HIVE-22961 Project: Hive Issue Type: Bug Components: Hive Affects Versions: 4.0.0 Reporter: Sam An Assignee: Sam An
Issue here is how HIVE sends theĀ "HivePrivilegeObjects" to Ranger when DROP fUNTION is done. This is different from how DROP TABLE is done. DROP TABLE the following is the request: {code:java} 'checkPrivileges':{'hiveOpType':DROPTABLE, 'inputHObjs':['HivePrivilegeObject':{'type':TABLE_OR_VIEW, 'dbName':testdemo, 'objectType':TABLE_OR_VIEW, 'objectName':t1, 'columns':[], 'partKeys':[], 'commandParams':[], 'actionType':OTHER, 'owner':systest}], 'outputHObjs':['HivePrivilegeObject':{'type':TABLE_OR_VIEW, 'dbName':testdemo, 'objectType':TABLE_OR_VIEW, 'objectName':t1, 'columns':[], 'partKeys':[], 'commandParams':[], 'actionType':OTHER, 'owner':systest}], 'context':{'clientType':HIVESERVER2, 'commandString':drop table t1, 'ipAddress':10.65.42.125, 'forwardedAddresses':null, 'sessionString':58f89a16-2df5-4124-af0e-913aabbefe06}, 'user':systest, 'groups':[systest, wheel]}{code} Where as in DROP FUNCTION: {code:java} {'hiveOpType':DROPFUNCTION, 'inputHObjs':['HivePrivilegeObject':{'type':FUNCTION, 'dbName':udfdemo, 'objectType':FUNCTION, 'objectName':aes1, 'columns':[], 'partKeys':[], 'commandParams':[], 'actionType':OTHER, 'owner':null}], 'outputHObjs':['HivePrivilegeObject':{'type':DATABASE, 'dbName':udfdemo, 'objectType':DATABASE, 'objectName':null, 'columns':[], 'partKeys':[], 'commandParams':[], 'actionType':OTHER, 'owner':systest},'HivePrivilegeObject':{'type':FUNCTION, 'dbName':udfdemo, 'objectType':FUNCTION, 'objectName':aes1, 'columns':[], 'partKeys':[], 'commandParams':[], 'actionType':OTHER, 'owner':null}], 'context':{'clientType':HIVESERVER2, 'commandString':drop function udfdemo.aes1, 'ipAddress':10.65.42.125, 'forwardedAddresses':null, 'sessionString':442ca4d3-f34a-470c-878a-18542b99016c}, 'user':systest, 'groups':[systest, wheel]} {code} in DROP function in outputHObjs, there is this addition, DATABASE object which should not there and this causes the Ranger requested to be generated differently. -- This message was sent by Atlassian Jira (v8.3.4#803005)