phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Liew (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-3312) Dividing int constant values should result in decimal
Date Sun, 13 Nov 2016 02:07:59 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-3312?page=com.atlassian.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 numbers at the JDBC
layer, otherwise we’d end up with strange things like `SELECT four / three * six` returning
7 instead of 8. 

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 decimal  (like 1/3
= 0 and not 0.33) 
> 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)

Mime
View raw message