[ https://issues.apache.org/jira/browse/RANGER-5097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17913562#comment-17913562 ]
Raghav Aggarwal commented on RANGER-5097: ----------------------------------------- Hi [~maheshbandal] , I am observing the issue in hive4 where create database and create table statement are throwing the following error in HS2 from ranger side. {code:java} 2025-01-15T00:47:41,778 ERROR [19b964a7-f44b-467b-b800-8afab88e760d HiveServer2-Handler-Pool: Thread-114]: authorizer.RangerHiveAuthorizer (:()) - failed to get table object from Hive metastore. dbName=raaggarw, tblName=employee org.apache.hadoop.hive.metastore.api.NoSuchObjectException: hive.raaggarw.employee table not found {code} _*Although, it is not impacting the functionality as table/database is getting created. It is more of a noise in the logs.*_ while debugging, i found that the fix is around the patch that you are doing in this ticket. I am attaching the stacktrace from HS2 as an attachment in this JIRA. [^create_table_HS2_stacktrace.txt] [^create_db_HS2_stacktrace.txt], > Fix setOwnerUser function to ensure the Hive default {owner} policy works > correctly > ----------------------------------------------------------------------------------- > > Key: RANGER-5097 > URL: https://issues.apache.org/jira/browse/RANGER-5097 > Project: Ranger > Issue Type: Bug > Components: Ranger > Affects Versions: 3.0.0 > Reporter: Mahesh Bandal > Assignee: Mahesh Bandal > Priority: Major > Attachments: create_db_HS2_stacktrace.txt, > create_table_HS2_stacktrace.txt > > > Create a Hive Table as spark user from beeline and then try accessing the > same table from spark3-shell. The select query on Hive Table fails. > {noformat} > create table spark_table_123 (name string); > select * from spark_table_123 > {noformat} > The below error is observed in spark3-shell > {noformat} > org.apache.spark.sql.AnalysisException: > org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch table > spark_table_123. Permission denied: user [spark] does not have [SELECT] > privilege on [default/spark_table_123] > {noformat} > Expectation: > The Hive default policy for "Owner" user allowing "all" Access on all Hive > Database, table & column should allow the access. -- This message was sent by Atlassian Jira (v8.20.10#820010)