[ 
https://issues.apache.org/jira/browse/HIVE-14100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15529496#comment-15529496
 ] 

Peter Vary edited comment on HIVE-14100 at 9/28/16 12:50 PM:
-------------------------------------------------------------

Thanks [~mohitsabharwal]!

Description is fixed, thanks for pointing out!

The "select current_user()" command will return the user provided by the 
configured HiveAuthenticationProvider. For some cases it is the same as logged 
in user, but some cases it provides the user that runs the hiveserver2 process.

The proposed patch adds a new udf which uses the sessionstate to get the 
username. This way providing the identifier of the logged in user provided at 
connection time. I think this is more consistent with the expected behavior for 
relational databases, but do not want to change the original function, since 
its' description explicitly states, that it will use the AuthenticationProvider.

I hope I was better at describing the problem now :)

Thanks,
Peter


was (Author: pvary):
Thanks [~mohitsabharwal]!

Description is fixed, thanks for pointing out!

The "select current_user()" command will return the user provided by the 
configured HiveAuthenticationProvider. For some cases it is the same as logged 
in user, but some cases it provides the user that runs the hiveserver2 process.

The proposed patch adds a new udf which uses the sessionstate to get the 
username. This way providing the identifier of the logged in user provided by 
the user at connection time. I think this is more consistent with the expected 
behavior for relational databases, but do not want to change the original 
function, since its' description explicitly states, that it will use the 
AuthenticationProvider.

I hope I was better at describing the problem now :)

Thanks,
Peter

> current_user() returns invalid information
> ------------------------------------------
>
>                 Key: HIVE-14100
>                 URL: https://issues.apache.org/jira/browse/HIVE-14100
>             Project: Hive
>          Issue Type: Bug
>          Components: Authentication, Beeline
>            Reporter: Peter Vary
>            Assignee: Peter Vary
>            Priority: Minor
>         Attachments: HIVE-14100.2.patch, HIVE-14100.2.patch, 
> HIVE-14100.2.patch, HIVE-14100.patch
>
>
> Using HadoopDeaultAuthenticator the current_user() returns the username of 
> the unix user running hiveservice2.
> Using SessionStateUserAuthenticator the current_user returns the username 
> which is provided when the connection started.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to