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 determine who ran query if Hive Impersonations = False?

Solved Go to solution
Highlighted

How to determine who ran query if Hive Impersonations = False?

Super Guru

I have hive impersonations set to false. Is there a simple way of determining who ran the job/query?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to determine who ran query if Hive Impersonations = False?

Explorer

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:

https://github.com/beto983/Hive-Utils/blob/master/README.md

View solution in original post

4 REPLIES 4
Highlighted

Re: How to determine who ran query if Hive Impersonations = False?

Explorer

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:

https://github.com/beto983/Hive-Utils/blob/master/README.md

View solution in original post

Highlighted

Re: How to determine who ran query if Hive Impersonations = False?

@Alberto Romero

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).

Re: How to determine who ran query if Hive Impersonations = False?

Explorer

@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.

Highlighted

Re: How to determine who ran query if Hive Impersonations = False?

Super Guru
Don't have an account?
Coming from Hortonworks? Activate your account here