Uh oh!
There was an error while loading. Please reload this page.
ARROW-10234: [C++][Gandiva] Fix logic of round() for floats/decimals in Gandiva - #8398
ARROW-10234: [C++][Gandiva] Fix logic of round() for floats/decimals in Gandiva#8398sgnkc wants to merge 1 commit into
Conversation
sgnkc
commented
Oct 8, 2020
@praveenbingo@pprudhvi Can you please review this change? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…in Gandiva This patch attempts to resolve the bug introduced by the addition of round() in ARROW-9641 round() for floats is returning incorrect results for some edge cases, like round(cast(1.55 as float), 1) gives 1.6, but it should be 1.5, since the result after casting 1.55 to float comes to 1.5499999523162842, due to inaccurate representation of floating point numbers in memory. Removing an intermediate explicit cast to float statement for a double value, which is used in subsequent computations, minimises the error introduced due to the incorrect representation.
nealrichardson
commented
Oct 8, 2020
Hi @sagnikc-dremio does this by chance resolve the build failure observed on ARROW-10177? Actually--let's run the tests, and if it doesn't, can you please take a look at that as well? |
nealrichardson
commented
Oct 8, 2020
@github-actions crossbow submit gandiva* |
Revision: b1ef543 Submitted crossbow builds: ursa-labs/crossbow @ actions-625
|
sgnkc
commented
Oct 9, 2020
This is a separate issue, not related to the gandiva-jar-xenial failures. I will look into it. |
…in Gandiva This patch attempts to resolve the bug introduced by the addition of round() in ARROW-9641 round() for floats is returning incorrect results for some edge cases, like round(cast(1.55 as float), 1) gives 1.6, but it should be 1.5, since the result after casting 1.55 to float comes to 1.5499999523162842, due to inaccurate representation of floating point numbers in memory. Removing an intermediate explicit cast to float statement for a double value, which is used in subsequent computations, minimises the error introduced due to the incorrect representation. Closesapache#8398 from sagnikc-dremio/round-double and squashes the following commits: b1ef543 <Sagnik Chakraborty> ARROW-10234: Fix logic of round() for floats/decimals in Gandiva Authored-by: Sagnik Chakraborty <sagnikc@dremio.com> Signed-off-by: Praveen <praveen@dremio.com>
This patch attempts to resolve the bug introduced by the addition of round() in ARROW-9641
round() for floats is returning incorrect results for some edge cases, like round(cast(1.55 as float), 1) gives 1.6, but it should be 1.5, since the result after casting 1.55 to float comes to 1.5499999523162842, due to inaccurate representation of floating point numbers in memory.
Removing an intermediate explicit cast to float statement for a double value, which is used in subsequent computations, minimises the error introduced due to the incorrect representation.