[jira] [Updated] (PHOENIX-3312) Dividing int constant values should result in decimal
[ 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)
[jira] [Updated] (PHOENIX-3312) Dividing int constant values should result in decimal
[ https://issues.apache.org/jira/browse/PHOENIX-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Taylor updated PHOENIX-3312: -- Description: 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. was: when dividing int column the value is in while it should be flout (like 1/3 = 0 and not 0.33) there is a work around to do 1/3.0 but this is not a solution. > 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 > Fix For: 4.9.0 > > > 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)
[jira] [Updated] (PHOENIX-3312) Dividing int constant values should result in decimal
[ https://issues.apache.org/jira/browse/PHOENIX-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Taylor updated PHOENIX-3312: -- Summary: Dividing int constant values should result in decimal (was: when dividing int column the value is in while it should be flout (like 1/3 = 0 and not 0.33) ) > 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 > Fix For: 4.9.0 > > > when dividing int column the value is in while it should be flout (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)