Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 39670200BC5 for ; Tue, 22 Nov 2016 14:28:25 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 38081160B0C; Tue, 22 Nov 2016 13:28:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7EE9A160B0A for ; Tue, 22 Nov 2016 14:28:24 +0100 (CET) Received: (qmail 85134 invoked by uid 500); 22 Nov 2016 13:28:23 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 85113 invoked by uid 99); 22 Nov 2016 13:28:23 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Nov 2016 13:28:23 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id BCBFA2F5A51; Tue, 22 Nov 2016 13:28:21 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4894550428842219308==" MIME-Version: 1.0 Subject: Review Request 53983: HIVE-14582 : Add trunc(numeric) udf From: chinnarao@huawei.com To: Ashutosh Chauhan Cc: hive , chinnarao@huawei.com Date: Tue, 22 Nov 2016 13:28:21 -0000 Message-ID: <20161122132821.27387.17701@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: noreply@reviews.apache.org X-ReviewGroup: hive X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/53983/ X-Sender: noreply@reviews.apache.org X-ReviewBoard-Diff-For: ql/src/test/queries/clientpositive/udf_trunc_number.q X-ReviewBoard-Diff-For: ql/src/test/results/clientpositive/udf_trunc_number.q.out Reply-To: chinnarao@huawei.com X-ReviewRequest-Repository: hive-git archived-at: Tue, 22 Nov 2016 13:28:25 -0000 --===============4894550428842219308== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/53983/ ----------------------------------------------------------- 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 ----- ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java e20ad65 ql/src/test/queries/clientpositive/udf_trunc_number.q 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 --===============4894550428842219308==--