You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Lefty Leverenz (JIRA)" <ji...@apache.org> on 2016/03/24 23:01:25 UTC

[jira] [Commented] (HIVE-9143) select user(), current_user()

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

Lefty Leverenz commented on HIVE-9143:
--------------------------------------

It's already documented in the UDFs doc under Misc. Functions (thanks, [~apivovarov]):

* [Hive Operators and UDFs -- Misc. Functions | https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-Misc.Functions]

Perhaps it should also be mentioned in the Authorization docs:

* [Hive Default Authorization -- Users, Groups, and Roles | https://cwiki.apache.org/confluence/display/Hive/Hive+Default+Authorization+-+Legacy+Mode#HiveDefaultAuthorization-LegacyMode-Users,Groups,andRoles]
* [SQL Standard Based Hive Authorization -- Users and Roles | https://cwiki.apache.org/confluence/display/Hive/SQL+Standard+Based+Hive+Authorization#SQLStandardBasedHiveAuthorization-UsersandRoles]

Hmmm ... the SQL Standards Based Auth doc needs a section on user commands, similar to Role Management Commands.  If it had that, current_user() should be documented there instead.

Ditto for Hive Default Authorization:  it has Creating/Dropping/Using Roles but no equivalent section for users.

> select user(), current_user()
> -----------------------------
>
>                 Key: HIVE-9143
>                 URL: https://issues.apache.org/jira/browse/HIVE-9143
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 0.13.0
>            Reporter: Hari Sekhon
>            Assignee: Alexander Pivovarov
>            Priority: Minor
>             Fix For: 1.2.0
>
>         Attachments: HIVE-9143.1.patch, HIVE-9143.2.patch, HIVE-9143.3.patch
>
>
> Feature request to add support for determining in HQL session which user I am currently connected as - an old MySQL ability:
> {code}mysql> select user(), current_user();
> +----------------+----------------+
> | user()         | current_user() |
> +----------------+----------------+
> | root@localhost | root@localhost |
> +----------------+----------------+
> 1 row in set (0.00 sec)
> {code}
> which doesn't seem to have a counterpart in Hive at this time:
> {code}0: jdbc:hive2://<host>:100> select user();
> Error: Error while compiling statement: FAILED: SemanticException Line 0:-1 Invalid function 'user' (state=42000,code=40000)
> 0: jdbc:hive2://<host>:100> select current_user();
> Error: Error while compiling statement: FAILED: SemanticException [Error 10011]: Line 1:7 Invalid function 'current_user' (state=42000,code=10011){code}
> Regards,
> Hari Sekhon
> http://www.linkedin.com/in/harisekhon



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