[ https://issues.apache.org/jira/browse/PHOENIX-915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13977832#comment-13977832 ]
Hudson commented on PHOENIX-915: -------------------------------- SUCCESS: Integrated in Phoenix-3.0 #71 (See [https://builds.apache.org/job/Phoenix-3.0/71/]) PHOENIX-915 Numeric functions ROUND, CEIL, FLOOR return incorrect results for DOUBLE (SamarthJain) (jamestaylor: rev 10642d84e25be2f305be4bcb607f4e439c088e6c) * phoenix-core/src/it/java/org/apache/phoenix/end2end/RoundFloorCeilFunctionsEnd2EndIT.java * phoenix-core/src/main/java/org/apache/phoenix/expression/function/RoundDecimalExpression.java > Numeric functions ROUND, CEIL, FLOOR return incorrect results for DOUBLE > ------------------------------------------------------------------------ > > Key: PHOENIX-915 > URL: https://issues.apache.org/jira/browse/PHOENIX-915 > Project: Phoenix > Issue Type: Bug > Affects Versions: 3.0.0, 4.0.0 > Reporter: alex kamil > Assignee: Samarth Jain > Fix For: 5.0.0, 3.1, 4.1 > > Attachments: PHOENIX-915.patch > > > numeric functions ROUND, CEIL, FLOOR return incorrect results for DOUBLE , > FLOAT, UNSIGNED_DOUBLE , UNSIGNED_FLOAT data types > (these functions work correctly only for DECIMAL) > >CREATE TABLE myproducts (id BIGINT NOT NULL PRIMARY KEY, price DOUBLE); > > UPSERT INTO myproducts (id,price) values (1,22.33); > >SELECT id, price, ROUND(price) as roundedPrice from myproducts; > +------------+------------+--------------+ > | ID | PRICE | ROUNDEDPRICE | > +------------+------------+--------------+ > | 1 | 22.33 | 1.0 | > (ROUND returns 1.0 instead of 22) > SELECT id, price, ROUND(price,1) as roundedPrice from myproducts; > +------------+------------+--------------+ > | ID | PRICE | ROUNDEDPRICE | > +------------+------------+--------------+ > | 1 | 22.33 | 0.5 | > (ROUND returns 0.5 instead of 22.3) > >SELECT id, price, CEIL(price) as roundedPrice from myproducts; > +------------+------------+--------------+ > | ID | PRICE | ROUNDEDPRICE | > +------------+------------+--------------+ > | 1 | 22.33 | 1.0 | > (CEIL returns 1.0 instead of 23) > >SELECT id, price, FLOOR(price) as roundedPrice from myproducts; > +------------+------------+--------------+ > | ID | PRICE | ROUNDEDPRICE | > +------------+------------+--------------+ > | 1 | 22.33 | 0.0 | > (FLOOR returns 0.0 instead of 22) > etc. -- This message was sent by Atlassian JIRA (v6.2#6252)