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 F0232200BD0 for ; Wed, 30 Nov 2016 20:04:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EED31160B13; Wed, 30 Nov 2016 19:04:14 +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 45C00160B06 for ; Wed, 30 Nov 2016 20:04:14 +0100 (CET) Received: (qmail 54334 invoked by uid 500); 30 Nov 2016 19:04:13 -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 54311 invoked by uid 99); 30 Nov 2016 19:04:12 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2016 19:04:12 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id AD64D2D8F54; Wed, 30 Nov 2016 19:04:12 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1903288782338611966==" MIME-Version: 1.0 Subject: Re: Review Request 53983: HIVE-14582 : Add trunc(numeric) udf From: chinnarao@huawei.com To: Ashutosh Chauhan Cc: hive , chinnarao@huawei.com Date: Wed, 30 Nov 2016 19:04:12 -0000 Message-ID: <20161130190412.1641.3034@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 References: <20161122132821.27387.17701@reviews.apache.org> In-Reply-To: <20161122132821.27387.17701@reviews.apache.org> X-ReviewBoard-Diff-For: ql/src/test/queries/clientpositive/udf_trunc_number.q X-ReviewBoard-Diff-For: data/files/trunc_number.txt X-ReviewBoard-Diff-For: data/files/trunc_number1.txt X-ReviewBoard-Diff-For: ql/src/test/results/clientpositive/udf_trunc_number.q.out X-ReviewBoard-Diff-For: ql/src/test/queries/clientnegative/udf_trunc_error3.q X-ReviewBoard-Diff-For: ql/src/test/results/clientnegative/udf_trunc_error3.q.out Reply-To: chinnarao@huawei.com X-ReviewRequest-Repository: hive-git archived-at: Wed, 30 Nov 2016 19:04:15 -0000 --===============1903288782338611966== 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/ ----------------------------------------------------------- (Updated Nov. 30, 2016, 7:04 p.m.) Review request for hive and Ashutosh Chauhan. Changes ------- Updated diff like, now trun() function will accept non constants as scale argument. Updated test cases also. All tests are pass in local environment. 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 (updated) ----- 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 --===============1903288782338611966==--