Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Capture SHOW PRIVILEGES into a TABLE
Labels:
- Labels:
-
Apache Hive
Explorer
Created on ‎12-05-2015 06:34 AM - edited ‎09-16-2022 02:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I insert the SHOW statements results into a HIVE table please?
Something like:
CREATE TABLE Capture_Previliges AS SHOW GRANT ROLE <ROLE_NAME>;
I want to capture this information into a table to further process and perform some audits please. If there isn't a simple way then what would be my options?
Want this below kind of info in a table:
0: jdbc:hive2://localhost:10000> show grant user ashutosh on table hivejiratable; +-----------+----------------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+ | database | table | partition | column | principal_name | principal_type | privilege | grant_option | grant_time | grantor | +-----------+----------------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+ | default | hivejiratable | | | ashutosh | USER | DELETE | false | 1398303419000 | thejas | | default | hivejiratable | | | ashutosh | USER | SELECT | false | 1398303407000 | thejas | +-----------+----------------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
1 REPLY 1
Mentor
Created ‎02-28-2016 07:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There's no current way to do this today, aside of scripting it by using the regular SHOW GRANT commands and then parsing the output into a file and then into a table.
