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.

Retrieve Logged In User in a Custom UDF.

Retrieve Logged In User in a Custom UDF.

New Contributor

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.