Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D5FF910B4B for ; Tue, 18 Feb 2014 22:21:31 +0000 (UTC) Received: (qmail 5266 invoked by uid 500); 18 Feb 2014 22:21:21 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 5101 invoked by uid 500); 18 Feb 2014 22:21:19 -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 5091 invoked by uid 500); 18 Feb 2014 22:21:19 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 5081 invoked by uid 99); 18 Feb 2014 22:21:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Feb 2014 22:21:19 +0000 Date: Tue, 18 Feb 2014 22:21:19 +0000 (UTC) From: "Xuefu Zhang (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-6459) Change the precison/scale for intermediate sum result in the avg() udf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-6459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xuefu Zhang updated HIVE-6459: ------------------------------ Status: Patch Available (was: Open) Initial patch. Expecting test result diff. > Change the precison/scale for intermediate sum result in the avg() udf > ----------------------------------------------------------------------- > > Key: HIVE-6459 > URL: https://issues.apache.org/jira/browse/HIVE-6459 > Project: Hive > Issue Type: Improvement > Components: UDF > Affects Versions: 0.13.0 > Reporter: Xuefu Zhang > Assignee: Xuefu Zhang > Attachments: HIVE-6459.patch > > > The avg() udf, when applied to a decimal column, selects the precision/scale of the intermediate sum field as (p+4, s+4), which is the same for the precision/scale of the avg() result. However, the additional scale increase is unnecessary, and the problem of data overflow may occur. The requested change is that for the intermediate sum result, the precsion/scale is set to (p+10, s), which is consistent to sum() udf. The avg() result still keeps its precision/scale. -- This message was sent by Atlassian JIRA (v6.1.5#6160)