hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Pivovarov" <apivova...@gmail.com>
Subject Re: Review Request 29900: HIVE-5472 support a simple scalar which returns the current timestamp
Date Wed, 28 Jan 2015 21:05:29 GMT

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



ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCurrentDate.java
<https://reviews.apache.org/r/29900/#comment115045>

    //you can use substring(0, 10) to get date part of the timestamp
    String dtStr = SessionState.get().getQueryCurrentTimestamp().toString().substring(0,10);
    dateVal = Date.valueOf(dtStr);


- Alexander Pivovarov


On Jan. 19, 2015, 10:01 p.m., Jason Dere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29900/
> -----------------------------------------------------------
> 
> (Updated Jan. 19, 2015, 10:01 p.m.)
> 
> 
> Review request for hive and Thejas Nair.
> 
> 
> Bugs: HIVE-5472
>     https://issues.apache.org/jira/browse/HIVE-5472
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Add current_date/current_timestamp. The UDFs get the current_date/timestamp from the
SessionState.
> 
> 
> Diffs
> -----
> 
>   common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 25cccd7 
>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 0226f28 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java d7c4ca7 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g f412010 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g c960a6b 
>   ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java f45b20a 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCurrentDate.java PRE-CREATION

>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCurrentTimestamp.java PRE-CREATION

>   ql/src/test/queries/clientpositive/current_date_timestamp.q PRE-CREATION 
>   ql/src/test/results/clientpositive/current_date_timestamp.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/show_functions.q.out 9ecb0a0 
> 
> Diff: https://reviews.apache.org/r/29900/diff/
> 
> 
> Testing
> -------
> 
> qfile test added
> 
> 
> Thanks,
> 
> Jason Dere
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message