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 63A00200BCD for ; Sun, 13 Nov 2016 03:08:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 621C1160B14; Sun, 13 Nov 2016 02:08:01 +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 CCA3E160B00 for ; Sun, 13 Nov 2016 03:08:00 +0100 (CET) Received: (qmail 90867 invoked by uid 500); 13 Nov 2016 02:07:59 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 90849 invoked by uid 99); 13 Nov 2016 02:07:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Nov 2016 02:07:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C27FC2C0276 for ; Sun, 13 Nov 2016 02:07:59 +0000 (UTC) Date: Sun, 13 Nov 2016 02:07:59 +0000 (UTC) From: "Kevin Liew (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PHOENIX-3312) Dividing int constant values should result in decimal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 13 Nov 2016 02:08:01 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3312?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kevin Liew updated PHOENIX-3312: -------------------------------- Attachment: PHOENIX-3312.patch I attached a patch with the proposed fix. I used rounding instead of flooring when converting decimals to whole numbe= rs at the JDBC layer, otherwise we=E2=80=99d end up with strange things lik= e `SELECT four / three * six` returning 7 instead of 8.=20 I expect one test case to fail due to the use of modulo on decimal data. > Dividing int constant values should result in decimal > ----------------------------------------------------- > > Key: PHOENIX-3312 > URL: https://issues.apache.org/jira/browse/PHOENIX-3312 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.6.0 > Reporter: noam bulvik > Assignee: Kevin Liew > Attachments: PHOENIX-3312.patch > > > When dividing int constants the result is an int while it should be decim= al (like 1/3 =3D 0 and not 0.33)=20 > There is a work around to do 1/3.0 but this is not a solution. -- This message was sent by Atlassian JIRA (v6.3.4#6332)