hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matyas Orhidi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-16551) logged_in_user() UDF returns NULL value in Hive CLI and SparkSQL
Date Thu, 27 Apr 2017 13:00:07 GMT

     [ https://issues.apache.org/jira/browse/HIVE-16551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Matyas Orhidi updated HIVE-16551:
---------------------------------
    Description: 
There is a recently added UDF defined in [HIVE-14100] which would return the logged in user
independently of the configured authenticator, however it is not working as expected and returns
NULL in HiveCLI and SparkSql on a Kerberized cluster:
{code}
beeline> select logged_in_user();
INFO  : Compiling command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb):
select logged_in_user()
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:_c0, type:string, comment:null)],
properties:null)
INFO  : Completed compiling command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb);
Time taken: 0.184 seconds
INFO  : Executing command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb):
select logged_in_user()
INFO  : Completed executing command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb);
Time taken: 0.003 seconds
INFO  : OK
+--------+--+
|  _c0   |
+--------+--+
| admin  |
+--------+--+
1 row selected (0.234 seconds)
{code}
{code}
spark> val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
sqlContext: org.apache.spark.sql.hive.HiveContext = org.apache.spark.sql.hive.HiveContext@4f1b2ea

spark> sqlContext.sql("select logged_in_user()").show()
+----+
| _c0|
+----+
|null|
+----+
{code}
{code}
hive> select logged_in_user();
OK
NULL
Time taken: 0.115 seconds, Fetched: 1 row(s)
hive>
{code}

  was:
There is a recently added UDF defined in [HIVE-14100] which would return the logged in user
independently of the configured authenticator, however it is not working as expected and returns
NULL in HiveCLI and SparkSql on a Kerberized cluster:

beeline> select logged_in_user();
INFO  : Compiling command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb):
select logged_in_user()
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:_c0, type:string, comment:null)],
properties:null)
INFO  : Completed compiling command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb);
Time taken: 0.184 seconds
INFO  : Executing command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb):
select logged_in_user()
INFO  : Completed executing command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb);
Time taken: 0.003 seconds
INFO  : OK
+--------+--+
|  _c0   |
+--------+--+
| admin  |
+--------+--+
1 row selected (0.234 seconds)


spark> val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
sqlContext: org.apache.spark.sql.hive.HiveContext = org.apache.spark.sql.hive.HiveContext@4f1b2ea

spark> sqlContext.sql("select logged_in_user()").show()
+----+
| _c0|
+----+
|null|
+----+

hive> select logged_in_user();
OK
NULL
Time taken: 0.115 seconds, Fetched: 1 row(s)
hive>


> logged_in_user() UDF returns NULL value in Hive CLI and SparkSQL
> ----------------------------------------------------------------
>
>                 Key: HIVE-16551
>                 URL: https://issues.apache.org/jira/browse/HIVE-16551
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Matyas Orhidi
>
> There is a recently added UDF defined in [HIVE-14100] which would return the logged in
user independently of the configured authenticator, however it is not working as expected
and returns NULL in HiveCLI and SparkSql on a Kerberized cluster:
> {code}
> beeline> select logged_in_user();
> INFO  : Compiling command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb):
select logged_in_user()
> INFO  : Semantic Analysis Completed
> INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:_c0, type:string,
comment:null)], properties:null)
> INFO  : Completed compiling command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb);
Time taken: 0.184 seconds
> INFO  : Executing command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb):
select logged_in_user()
> INFO  : Completed executing command(queryId=hive_20170426053636_82858063-792c-4772-8c3b-fccc0ba38afb);
Time taken: 0.003 seconds
> INFO  : OK
> +--------+--+
> |  _c0   |
> +--------+--+
> | admin  |
> +--------+--+
> 1 row selected (0.234 seconds)
> {code}
> {code}
> spark> val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
> sqlContext: org.apache.spark.sql.hive.HiveContext = org.apache.spark.sql.hive.HiveContext@4f1b2ea
> spark> sqlContext.sql("select logged_in_user()").show()
> +----+
> | _c0|
> +----+
> |null|
> +----+
> {code}
> {code}
> hive> select logged_in_user();
> OK
> NULL
> Time taken: 0.115 seconds, Fetched: 1 row(s)
> hive>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message