Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0AB3219193 for ; Mon, 4 Apr 2016 13:41:26 +0000 (UTC) Received: (qmail 92100 invoked by uid 500); 4 Apr 2016 13:41:25 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 92028 invoked by uid 500); 4 Apr 2016 13:41:25 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 91988 invoked by uid 99); 4 Apr 2016 13:41:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Apr 2016 13:41:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 984D42C1F61 for ; Mon, 4 Apr 2016 13:41:25 +0000 (UTC) Date: Mon, 4 Apr 2016 13:41:25 +0000 (UTC) From: "Nico Haller (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-11485) ArithmeticException in avgFunctionForDecimal 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/CASSANDRA-11485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15224135#comment-15224135 ] Nico Haller commented on CASSANDRA-11485: ----------------------------------------- Hi Robert, I am able to reproduce this in 3.3 Here would be an easy way to reproduce it (this throws the exception but it also returns the exception to the client. I am still looking for an easy way to reproduce the non-returning state): create table test (bucket int primary key, val decimal); insert into test (bucket, val) values (1, 0.25); insert into test (bucket, val) values (2, 0.25); insert into test (bucket, val) values (3, 0.5); select avg(val) from test where bucket in (1, 2, 3); => ServerError: > ArithmeticException in avgFunctionForDecimal > -------------------------------------------- > > Key: CASSANDRA-11485 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11485 > Project: Cassandra > Issue Type: Bug > Components: CQL > Reporter: Nico Haller > Priority: Minor > > I am running into issues when using avg in queries on decimal values. > It throws an ArithmeticException in org/apache/cassandra/cql3/functions/AggregateFcts.java (Line 184). > So whenever an exact representation of the quotient is not possible it will throw that error and it never returns to the querying client. > I am not so sure if this is intended behavior or a bug, but in my opinion if an exact representation of the value is not possible, it should automatically round the value. > Specifying a rounding mode when calling the divide function should solve the issue -- This message was sent by Atlassian JIRA (v6.3.4#6332)