Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.1.2
-
None
-
None
Description
alter database set location 'hdfs://xxxx' command fails with the following error:
FAILED: HiveAccessControlException Permission denied: Principal [name=admin, type=USER] does not have following privileges for operation ALTERDATABASE_LOCATION [[ADMIN PRIVILEGE] on Object [type=DFS_URI, name=hdfs://xxxx]]
It checks if the user has the admin privilege on the location path. However only OWNER_PRIV, INSERT_NOGRANT, DELETE_NOGRANT or SELECT_NOGRANT can be returned from getPrivilegesFromFS() function call. i.e. There's no mapping from admin privilege to the hdfs access privilege. So I suggest using INS_SEL_DEL_NOGRANT_AR instead of admin privilege checking. Patch is attached for review, thanks.