> On Feb. 3, 2015, 10:31 a.m., Jason Dere wrote:
> >

I.
I tested the current_user() function for SQL Std auth. See below
1. I configured hive the following way. hive-site.xml
{code}
  <property>
    <name>hive.server2.enable.doAs</name>
    <value>false</value>
  </property>
  <property>
    <name>hive.security.authorization.manager</name>
    
<value>org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory</value>
  </property>
  <property>
    <name>hive.security.authorization.enabled</name>
    <value>true</value>
  </property>
  <property>
    <name>hive.security.authenticator.manager</name>
    
<value>org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator</value>
  </property>
  <property>
    <name>hive.metastore.uris</name>
    <value></value>
  </property>
  <property>
    <name>hive.users.in.admin.role</name>
    <value>apivovarov</value>
  </property>
{code}

2. I started hiveserver2
3. I connected to hs2 as admin user "apivovarov"
4. I run "set role admin;"
5. I run "select current_user() from dual;". result: apivovarov
6. I have dual table in default db. I run "grant select on dual to role public;"
7. I connected to hs2 as regular user "alex"
8. I run "select current_user() from dual;". result: alex

So, current_user() works for SQL Standard Based Hive Authorization

II.
I also tested current_user() function for "apivovarov" and "alex" users using 
default hive settings (DefaultHiveAuthorization)


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30487/#review70730
-----------------------------------------------------------


On Feb. 2, 2015, 10:42 p.m., Alexander Pivovarov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30487/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2015, 10:42 p.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-9143
>     https://issues.apache.org/jira/browse/HIVE-9143
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> HIVE-9143 impl current_user() udf
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 
> bfb4dc292b6b9f1ee342bb2e28b2afc722bb3167 
>   
> ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCurrentUser.java 
> PRE-CREATION 
>   ql/src/test/queries/clientpositive/udf_current_user.q PRE-CREATION 
>   ql/src/test/results/clientpositive/show_functions.q.out 
> e21b54bd6c3b5f51eb45c733bbe838fd78abe641 
>   ql/src/test/results/clientpositive/udf_current_user.q.out PRE-CREATION 
>   shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java 
> c851dc2cb28876aef77811ead397429a2338cde4 
> 
> Diff: https://reviews.apache.org/r/30487/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alexander Pivovarov
> 
>

Reply via email to