Github user bomeng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11086#discussion_r52084317
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/QueryTest.scala ---
    @@ -350,6 +350,9 @@ object QueryTest {
         Row.fromSeq(row.toSeq.map {
           case null => null
           case d: java.math.BigDecimal => BigDecimal(d)
    +      // Round up the values to avoid approximate error
    +      case f : Float => BigDecimal(f).setScale(8, 
BigDecimal.RoundingMode.HALF_UP).toFloat
    --- End diff --
    
    @davies, I am still not sure in which case, 1111111111111111.1 needs to be 
rounded up? In my opinion, this value does not need to do so. In my test cases, 
compare 0.1 + 0.2 with 0.3 will fail the test cases, but it only generate a 
very small error, it won't be difference of 0.1. Can you give me a specific 
case so I can test and fix my codes?  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to