-
- Downloads
[SPARK-14163][CORE] SumEvaluator and countApprox cannot reliably handle RDDs of size 1
## What changes were proposed in this pull request? This special cases 0 and 1 counts to avoid passing 0 degrees of freedom. ## How was this patch tested? Tests run successfully. New test added. ## Note: This recreates #11982 which was closed to due to non-updated diff. rxin srowen Commented there. This also adds tests, reworks the code to perform the special casing (based on srowen's comments), and adds equality machinery for BoundedDouble, as well as changing how it is transformed to string. Author: Marcin Tustin <mtustin@handybook.com> Author: Marcin Tustin <mtustin@handy.com> Closes #12016 from mtustin-handy/SPARK-14163.
Showing
- core/src/main/scala/org/apache/spark/partial/BoundedDouble.scala 18 additions, 0 deletions...c/main/scala/org/apache/spark/partial/BoundedDouble.scala
- core/src/main/scala/org/apache/spark/partial/SumEvaluator.scala 23 additions, 13 deletions...rc/main/scala/org/apache/spark/partial/SumEvaluator.scala
- core/src/test/scala/org/apache/spark/partial/SumEvaluatorSuite.scala 107 additions, 0 deletions...st/scala/org/apache/spark/partial/SumEvaluatorSuite.scala
Please register or sign in to comment