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 3E52E104E1 for ; Fri, 13 Dec 2013 04:17:26 +0000 (UTC) Received: (qmail 43077 invoked by uid 500); 13 Dec 2013 04:17:18 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 42687 invoked by uid 500); 13 Dec 2013 04:17:15 -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 42674 invoked by uid 500); 13 Dec 2013 04:17:11 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 42670 invoked by uid 99); 13 Dec 2013 04:17:09 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 04:17:09 +0000 Date: Fri, 13 Dec 2013 04:17:09 +0000 (UTC) From: "Xuefu Zhang (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-5996) Query for sum of a long column of a table with only two rows produces wrong result 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-5996?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xuefu Zhang updated HIVE-5996: ------------------------------ Status: Open (was: Patch Available) > Query for sum of a long column of a table with only two rows produces wrong result > ---------------------------------------------------------------------------------- > > Key: HIVE-5996 > URL: https://issues.apache.org/jira/browse/HIVE-5996 > Project: Hive > Issue Type: Bug > Components: UDF > Affects Versions: 0.12.0 > Reporter: Xuefu Zhang > Assignee: Xuefu Zhang > Attachments: HIVE-5996.patch > > > {code} > hive> desc test2; > OK > l bigint None > hive> select * from test2; > OK > 6666666666666666666 > 5555555555555555555 > hive> select sum(l) from test2; > OK > -6224521851487329395 > {code} > It's believed that a wrap-around error occurred. It's surprising that it happens only with two rows. Same query in MySQL returns: > {code} > mysql> select sum(l) from test; > +----------------------+ > | sum(l) | > +----------------------+ > | 12222222222222222221 | > +----------------------+ > 1 row in set (0.00 sec) > {code} > Hive should accommodate large number of rows. Overflowing with only two rows is very unusable. -- This message was sent by Atlassian JIRA (v6.1.4#6159)