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



ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCurrentUser.java
<https://reviews.apache.org/r/30487/#comment115843>

    In Thejas' review of HIVE-5472 (current_date/current_timestamp), he pointed 
out that the udftype can probably be set to deterministic because the value of 
current_user() should not change within the same query. Looks like we currently 
do not have a type to describe UDFs whose value is constant within the query 
but can change between queries, which this and current_date/current_timestamp 
fall under.



ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCurrentUser.java
<https://reviews.apache.org/r/30487/#comment115874>

    Can you also add setters/getters to currentUser? Hive needs to 
serialize/deserialize the query plan, and there are 2 options here: javaXML 
(XMLEncoder) and kryo serialization. In the case of javaXML serialization 
appropriate getters/setters need to exist for non-transient fields that need to 
be preserved.



ql/src/test/queries/clientpositive/udf_current_user.q
<https://reviews.apache.org/r/30487/#comment115875>

    Take a look at clientpositive/authorization_view_sqlstd.q, I think this has 
an example of being able to set the hive username to a fixed value during a 
test.  Can you see if this works for testing current_user()?


- Jason Dere


On Feb. 1, 2015, 8:20 p.m., Alexander Pivovarov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30487/
> -----------------------------------------------------------
> 
> (Updated Feb. 1, 2015, 8:20 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 
> 23d77ca4cc2e2a44b62f62ddbd4826df092bcfe8 
>   
> 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 
> 36c8743a61c55a714352d358a5d9cc0deb4cef2c 
>   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