Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 90635100B0 for ; Wed, 28 May 2014 23:30:26 +0000 (UTC) Received: (qmail 70604 invoked by uid 500); 28 May 2014 23:30:26 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 70579 invoked by uid 500); 28 May 2014 23:30:26 -0000 Mailing-List: contact issues-help@drill.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.incubator.apache.org Delivered-To: mailing list issues@drill.incubator.apache.org Received: (qmail 70570 invoked by uid 99); 28 May 2014 23:30:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 May 2014 23:30:26 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 28 May 2014 23:30:27 +0000 Received: (qmail 70086 invoked by uid 99); 28 May 2014 23:30:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 May 2014 23:30:02 +0000 Date: Wed, 28 May 2014 23:30:02 +0000 (UTC) From: "Chun Chang (JIRA)" To: issues@drill.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-834) The sum() operator should automatically promote to a type that can hold the sum MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DRILL-834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14011813#comment-14011813 ] Chun Chang commented on DRILL-834: ---------------------------------- We are working with big data. We should anticipate that sum() will overflow the original type quite often. The correct behavior should be to automatically promote the type to a bigger type that will give correct result. postgres, which is not designed for "big data", handles it that way. We definitely should do the same here. > The sum() operator should automatically promote to a type that can hold the sum > ------------------------------------------------------------------------------- > > Key: DRILL-834 > URL: https://issues.apache.org/jira/browse/DRILL-834 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Operators > Reporter: Chun Chang > Assignee: Chun Chang > Priority: Blocker > > The sum() of a type may exceed the type range, hence, should implicitly and automatically promote to a type that can hold the sum. Currently, the sum just overflows into negative (see JIRA833) and gives wrong result. -- This message was sent by Atlassian JIRA (v6.2#6252)