Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18031#discussion_r117663622
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala ---
    @@ -178,11 +203,20 @@ private[spark] object HighlyCompressedMapStatus {
         // we expect that there will be far fewer of them, so we will perform 
fewer bitmap insertions.
         val emptyBlocks = new RoaringBitmap()
         val totalNumBlocks = uncompressedSizes.length
    +    val threshold = Option(SparkEnv.get)
    +      .map(_.conf.get(config.SHUFFLE_ACCURATE_BLOCK_THRESHOLD))
    +      .getOrElse(config.SHUFFLE_ACCURATE_BLOCK_THRESHOLD.defaultValue.get)
    +    val hugeBlockSizesArray = ArrayBuffer[Tuple2[Int, Byte]]()
         while (i < totalNumBlocks) {
           var size = uncompressedSizes(i)
           if (size > 0) {
             numNonEmptyBlocks += 1
    -        totalSize += size
    +        // Remove the huge blocks from the calculation for average size 
and have accurate size for
    +        // smaller blocks.
    +        if (size > threshold) {
    +          totalSize += size
    --- End diff --
    
    this should be put in the else branch


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