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

    https://github.com/apache/spark/pull/6397#discussion_r31142325
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/sort/SortShuffleWriter.scala ---
    @@ -49,18 +50,27 @@ private[spark] class SortShuffleWriter[K, V, C](
     
       /** Write a bunch of records to this task's output */
       override def write(records: Iterator[Product2[K, V]]): Unit = {
    -    if (dep.mapSideCombine) {
    +    sorter = if (dep.mapSideCombine) {
           require(dep.aggregator.isDefined, "Map-side combine without 
Aggregator specified!")
    -      sorter = new ExternalSorter[K, V, C](
    +      new ExternalSorter[K, V, C](
             dep.aggregator, Some(dep.partitioner), dep.keyOrdering, 
dep.serializer)
    -      sorter.insertAll(records)
    +    } else if (SortShuffleWriter.shouldBypassMergeSort(
    +        SparkEnv.get.conf, dep.partitioner.numPartitions, aggregator = 
None, dep.keyOrdering)) {
    --- End diff --
    
    This was a mistake that I forgot to fix in my last push (the tests catch it 
though); will fix this morning.
    
    Sent from my phone
    
    > On May 27, 2015, at 7:38 AM, Shixiong Zhu <[email protected]> 
wrote:
    > 
    > In 
core/src/main/scala/org/apache/spark/shuffle/sort/SortShuffleWriter.scala:
    > 
    > >          dep.aggregator, Some(dep.partitioner), dep.keyOrdering, 
dep.serializer)
    > > -      sorter.insertAll(records)
    > > +    } else if (SortShuffleWriter.shouldBypassMergeSort(
    > > +        SparkEnv.get.conf, dep.partitioner.numPartitions, aggregator = 
None, dep.keyOrdering)) {
    > In the previous codes, if dep.mapSideCombine == false, the ordering is 
None. Why do you change it to dep.keyOrdering?
    > 
    > —
    > Reply to this email directly or view it on GitHub.
    > 



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