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

    https://github.com/apache/spark/pull/11981#discussion_r57520944
  
    --- Diff: core/src/main/scala/org/apache/spark/partial/SumEvaluator.scala 
---
    @@ -42,6 +42,14 @@ private[spark] class SumEvaluator(totalOutputs: Int, 
confidence: Double)
           new BoundedDouble(counter.sum, 1.0, counter.sum, counter.sum)
         } else if (outputsMerged == 0) {
           new BoundedDouble(0, 0.0, Double.NegativeInfinity, 
Double.PositiveInfinity)
    +    } else if (counter.count == 0) {
    +      new BoundedDouble(0, 0.0, Double.NegativeInfinity, 
Double.PositiveInfinity)
    +    } else if (counter.count == 1) {
    +      val p = outputsMerged.toDouble / totalOutputs
    --- End diff --
    
    This duplicates code in the following block. I think you can compute the 
common values in one shared block and then branch afterwards to handle count == 
1. 


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to