> On Dec. 1, 2016, 12:05 a.m., Vineet Garg wrote:
> > ql/src/test/queries/clientnegative/udf_trunc_error3.q, line 1
> > <https://reviews.apache.org/r/53983/diff/2/?file=1573142#file1573142line1>
> >
> >     I think it'll be good to add tests with negative numbers as well as 
> > no-op (e.g. select trunc (12.34, 100).

Thanks for the review. I will add tests as part of this JIRA HIVE-15325


- Chinna Rao


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


On Nov. 30, 2016, 7:04 p.m., Chinna Rao Lalam wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53983/
> -----------------------------------------------------------
> 
> (Updated Nov. 30, 2016, 7:04 p.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Overload trunc() function to accept numbers.
> 
> Now trunc() will accept date or number type arguments and it will behave as 
> below
> 
> trunc(date, fmt) / trunc(N,D) - Returns
> 
> If input is date returns date with the time portion of the day truncated to 
> the unit specified by the format model fmt. 
> If you omit fmt, then date is truncated to "the nearest day. It now only 
> supports 'MONTH'/'MON'/'MM' and 'YEAR'/'YYYY'/'YY' as format.
> 
> If input is a number group returns N truncated to D decimal places. If D is 
> omitted, then N is truncated to 0 places.
> D can be negative to truncate (make zero) D digits left of the decimal point.
> 
> 
> Diffs
> -----
> 
>   data/files/trunc_number.txt PRE-CREATION 
>   data/files/trunc_number1.txt PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java 
> e20ad65 
>   ql/src/test/queries/clientnegative/udf_trunc_error3.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/udf_trunc_number.q PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_trunc_error1.q.out 5d65b11 
>   ql/src/test/results/clientnegative/udf_trunc_error2.q.out 55a2185 
>   ql/src/test/results/clientnegative/udf_trunc_error3.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/udf_trunc.q.out 4c9f76d 
>   ql/src/test/results/clientpositive/udf_trunc_number.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/53983/diff/
> 
> 
> Testing
> -------
> 
> All tests are pass.
> 
> 
> Thanks,
> 
> Chinna Rao Lalam
> 
>

Reply via email to