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 30335: Build UDF TRUNC to implement FIRST_DAY as compared with LAST_DAY
Date Fri, 06 Feb 2015 00:29:28 GMT

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



ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java
<https://reviews.apache.org/r/30335/#comment117034>

    move it under switch block



ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java
<https://reviews.apache.org/r/30335/#comment117035>

    move it under switch block



ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java
<https://reviews.apache.org/r/30335/#comment117036>

    move it under switch block



ql/src/test/queries/clientnegative/udf_trunc_error1.q
<https://reviews.apache.org/r/30335/#comment117037>

    valid sql. should return null



ql/src/test/queries/clientpositive/udf_trunc.q
<https://reviews.apache.org/r/30335/#comment117038>

    use 0, 2 or 4 spaces for indent



ql/src/test/queries/clientpositive/udf_trunc.q
<https://reviews.apache.org/r/30335/#comment117040>

    remove FROM clause 
    the following should work
    SELECT	TRUNC('2014-01-01', 'MM');



ql/src/test/queries/clientpositive/udf_trunc.q
<https://reviews.apache.org/r/30335/#comment117039>

    can you add the following tests
    trunc('2014-01-34', 'MM'),
    trunc(cast(null as string), 'MM'),
    trunc(cast(null as date), 'MM'),
    trunc(cast(null as timestamp), 'MM')



ql/src/test/queries/clientpositive/udf_trunc.q
<https://reviews.apache.org/r/30335/#comment117041>

    do not need FROM



ql/src/test/results/clientnegative/udf_trunc_error4.q.out
<https://reviews.apache.org/r/30335/#comment117042>

    why error says Wrong arguments ''MM''
    it should be Wrong arguments '1.0'



ql/src/test/results/clientnegative/udf_trunc_error5.q.out
<https://reviews.apache.org/r/30335/#comment117043>

    why Wrong arguments ''MM'' ?
    MM is the second argument


- Alexander Pivovarov


On Feb. 5, 2015, 11:33 p.m., XIAOBING ZHOU wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30335/
> -----------------------------------------------------------
> 
> (Updated Feb. 5, 2015, 11:33 p.m.)
> 
> 
> Review request for hive.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Hive already supports LAST_DAY UDF, in some cases, FIRST_DAY is necessary to do date/timestamp
related computation. This JIRA is to track such an implementation.
> 
> https://issues.apache.org/jira/browse/HIVE-9480
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java bfb4dc2 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java PRE-CREATION

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

>   ql/src/test/queries/clientnegative/udf_trunc_error1.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_trunc_error2.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_trunc_error3.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_trunc_error4.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_trunc_error5.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/udf_trunc.q PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_trunc_error1.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_trunc_error2.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_trunc_error3.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_trunc_error4.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_trunc_error5.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/show_functions.q.out e21b54b 
>   ql/src/test/results/clientpositive/udf_trunc.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/30335/diff/
> 
> 
> Testing
> -------
> 
> Unit tests done in ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFFirstDay.java
> 
> 
> Thanks,
> 
> XIAOBING ZHOU
> 
>


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