Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to set select permission for a table in specified database for sentry policy in Hive?

SOLVED Go to solution

How to set select permission for a table in specified database for sentry policy in Hive?

Explorer

To set up policy for sentry service, I saw that there is an example of set select permission for a database on cloudera doc:

 

GRANT SELECT ON DATABASE jranalyst1 TO ROLE analyst_role;

 

How can I set the select permission on table A in Database B to Role C ? Thanks!

Innovation Never Die
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to set select permission for a table in specified database for sentry policy in Hive?

Cloudera Employee

You can switch to the database and grant privileges on the table.

 

USE jranalyst;

GRANT SELECT ON TABLE a TO ROLE c;

 

Hive currently doesnt support fully qualified table names (db1.tb1) in grant/revoke sql, and that is the reason you will need to switch to the database first to be able to grant privileges on a table.

 

1 REPLY 1
Highlighted

Re: How to set select permission for a table in specified database for sentry policy in Hive?

Cloudera Employee

You can switch to the database and grant privileges on the table.

 

USE jranalyst;

GRANT SELECT ON TABLE a TO ROLE c;

 

Hive currently doesnt support fully qualified table names (db1.tb1) in grant/revoke sql, and that is the reason you will need to switch to the database first to be able to grant privileges on a table.