Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How to find out the roles / groups assigned to a schema / DB in Hive

avatar
Explorer

Hi All,

 

I want to find out what are the roles / groups assigned to a DB / Schema in Hive, how I can get those details ? please suggest.

 

Thank you.

 

Regards,

PK

1 ACCEPTED SOLUTION

avatar
Expert Contributor

PK,

If you have access to the Sentry Store backend use a query like this:

 

SELECT
r.ROLE_NAME,
g.GROUP_NAME,
p.*,
FROM_UNIXTIME(p.CREATE_TIME / 1000) as CREATE_TIME_DATE
FROM
SENTRY_ROLE r
INNER JOIN SENTRY_ROLE_GROUP_MAP rgm ON r.ROLE_ID = rgm.ROLE_ID
INNER JOIN SENTRY_GROUP g ON g.GROUP_ID = rgm.GROUP_ID
INNER JOIN SENTRY_ROLE_DB_PRIVILEGE_MAP rpm ON r.ROLE_ID = rpm.ROLE_ID
INNER JOIN SENTRY_DB_PRIVILEGE p ON p.DB_PRIVILEGE_ID = rpm.DB_PRIVILEGE_ID;

 

Hope it helps,

-JMP

View solution in original post

10 REPLIES 10

avatar
Cloudera Employee

I tested this in 7.1.9 SP1 CHF 4, with Postgres

cdebernardi_0-1737577164387.png