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

    https://github.com/apache/spark/pull/11086#discussion_r52098824
  
    --- 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 --
    
    In your case, the difference between 2 numbers is too large to be 
considered as same, The 2 value should be compared in its absolute value, not 
relative. The float error won't be that large in the real world, and it should 
fail the test.


---
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