- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to determine who ran query if Hive Impersonations = False?
- Labels:
-
Apache Hive
Created ‎04-20-2016 02:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have hive impersonations set to false. Is there a simple way of determining who ran the job/query?
Created ‎04-20-2016 10:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sunile,
You can use a Hive hook to determine who submitted the query, even with doAs=false. As an example you can even use that to direct the query to an specific YARN queue. See the following for more info:
Created ‎04-20-2016 10:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sunile,
You can use a Hive hook to determine who submitted the query, even with doAs=false. As an example you can even use that to direct the query to an specific YARN queue. See the following for more info:
Created ‎04-24-2016 01:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Notice that if you are re-using initialized sessions (hive.server2.tez.initialize.default.sessions) this solution will not work, because the properties are created only when the AM starts. When you use default sessions the AM will be created before your hook can define a custom property.
The hook solution work for non-default tez sessions and also for map-reduce.
Find here some rest calls to RM API that works for all Tez scenarios (but not for map-reduce engine).
Created ‎04-24-2016 07:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Guilherme Braccialli Indeed, the hook is for not reusing initialised sessions.
Thanks very much for sharing the REST calls. Look quite useful to have handy.
Created ‎04-22-2016 07:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks to @Guilherme Braccialli I found it can be done via tez api calls.
some examples thanks to @Guilherme Braccialli
