Reply
Highlighted
New Contributor
Posts: 1
Registered: ‎07-30-2017

Retrieve Logged In User in a Custom UDF.

Hi,

I have a need to get the "Logged In User" in my Custom UDF to decide a course of action(not access related).
There is a hiveconf variable(hive.access.subject.name) that can be passed in the UDF call but i would like to get that value in my "evaluate" method that will be overriden in the Custom UDF.
Tried using

 

SessionState.get().getUserName();


this only works when the query(UDF) runs on the HS2 but will return a null when a mapreduce job is needed.

Is there any way that this can be accomplished?
Thanks in Advance!!!

Thanks,
Prashant.

Announcements