Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.13.0
    • Fix Version/s: 1.2.0
    • Component/s: None
    • Labels:
      None
    • Release Note:
      Hide
      Adds a UDF current_user that returns current user name
      Example -
      {code}
      hive> select current_user();
      OK
      thejas
      Time taken: 1.786 seconds, Fetched: 1 row(s)
      {code}
      Show
      Adds a UDF current_user that returns current user name Example - {code} hive> select current_user(); OK thejas Time taken: 1.786 seconds, Fetched: 1 row(s) {code}

      Description

      Feature request to add support for determining in HQL session which user I am currently connected as - an old MySQL ability:

      mysql> select user(), current_user();
      +----------------+----------------+
      | user()         | current_user() |
      +----------------+----------------+
      | root@localhost | root@localhost |
      +----------------+----------------+
      1 row in set (0.00 sec)
      

      which doesn't seem to have a counterpart in Hive at this time:

      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)

      Regards,

      Hari Sekhon
      http://www.linkedin.com/in/harisekhon

        Attachments

        1. HIVE-9143.1.patch
          7 kB
          Alexander Pivovarov
        2. HIVE-9143.2.patch
          7 kB
          Alexander Pivovarov
        3. HIVE-9143.3.patch
          7 kB
          Alexander Pivovarov

          Issue Links

            Activity

              People

              • Assignee:
                apivovarov Alexander Pivovarov
                Reporter:
                harisekhon Hari Sekhon
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: