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

    https://github.com/apache/spark/pull/1064#discussion_r14051999
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/hash/HashShuffleReader.scala ---
    @@ -31,10 +31,24 @@ class HashShuffleReader[K, C](
       require(endPartition == startPartition + 1,
         "Hash shuffle currently only supports fetching one partition")
     
    +  private val dep = handle.dependency
    +
       /** Read the combined key-values for this reduce task */
       override def read(): Iterator[Product2[K, C]] = {
    -    BlockStoreShuffleFetcher.fetch(handle.shuffleId, startPartition, 
context,
    -      Serializer.getSerializer(handle.dependency.serializer))
    +    val iter = BlockStoreShuffleFetcher.fetch(handle.shuffleId, 
startPartition, context,
    +      Serializer.getSerializer(dep.serializer))
    +
    +    if (dep.aggregator.isDefined) {
    +      if (dep.mapSideCombine) {
    +        dep.aggregator.get.combineCombinersByKey(iter, context)
    +      } else {
    +        dep.aggregator.get.combineValuesByKey(iter, context)
    --- End diff --
    
    So the one problem I see is that the InterruptibleIterator around these 
calls was lost when you moved them here. This is not great because it means 
tasks running these won't be cancelable. Can you add it back? You already have 
a TaskContext as a field of ShuffleReader.


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

Reply via email to