Get user running HIVE job?

Viewed 2176

I am running a HIVE job with my UDF extended class. I want to get the name of the user that submits my job, so i am using

System.getProperty("user.name");

to get the username but the problem is this is returning user mapred, and on the jobtracker the job is showing user name hdfs. I am currentely logged in as hdfs so the job is submitted by hdfs, so y is

  System.getProperty("user.name");

retuning an incorrect value:- mapred

Can anyone please tell me why this is happening and any alternate of getting the user name in the evaluate method of UDF

3 Answers
Related