You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Deepesh Khandelwal <de...@hotmail.com> on 2017/03/16 20:21:17 UTC
Re: Review Request 57701: HIVE-16234: Add support for quarter in
trunc udf
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57701/
-----------------------------------------------------------
(Updated March 16, 2017, 8:21 p.m.)
Review request for hive, Ashutosh Chauhan and Jason Dere.
Bugs: HIVE-16234
https://issues.apache.org/jira/browse/HIVE-16234
Repository: hive-git
Description (updated)
-------
Hive has a Date function trunc(string date, string format) that returns date truncated to the unit specified by the format. Supported formats: MONTH/MON/MM, YEAR/YYYY/YY.
Goal here is to extend support to QUARTER/Q.
Example:
SELECT trunc('2017-03-15', 'Q');
'2017-01-01'
SELECT trunc('2017-12-31', 'Q');
'2017-10-01'
Diffs
-----
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java a95248f
ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFTrunc.java 0021249
ql/src/test/queries/clientpositive/udf_trunc.q 2ac40cf
ql/src/test/results/clientpositive/udf_trunc.q.out 7874d52
Diff: https://reviews.apache.org/r/57701/diff/1/
Testing
-------
Added unit tests
Thanks,
Deepesh Khandelwal