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

    https://github.com/apache/spark/pull/17533#discussion_r111264930
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala 
---
    @@ -472,6 +472,47 @@ class DAGScheduler(
       }
     
       /**
    +   * Get ancestor splits in ShuffledRDD.
    +   */
    +  private[spark] def parentSplitsInShuffledRDD(stageId: Int, pId: Int): 
Option[Map[Int, Set[Int]]] =
    +  {
    +    stageIdToStage.get(stageId) match {
    +      case Some(stage) =>
    +        val waitingForVisit = new Stack[Tuple2[RDD[_], Int]]
    +        waitingForVisit.push((stage.rdd, pId))
    +        val ret = new HashMap[Int, HashSet[Int]]()
    +        while(waitingForVisit.nonEmpty) {
    +          val (rdd, split) = waitingForVisit.pop()
    +          if (getCacheLocs(rdd)(split) == Nil) {
    +            rdd.dependencies.foreach {
    +              case dep: ShuffleDependency[_, _, _] =>
    +                val noPartitionerConflict = rdd.partitioner match {
    +                  case Some(partitioner) =>
    +                    partitioner.isInstanceOf[HashPartitioner] &&
    +                    dep.partitioner.isInstanceOf[HashPartitioner] &&
    +                    partitioner.numPartitions == 
dep.partitioner.numPartitions
    --- End diff --
    
    (a) I don't really understand what is going on here.  why would 
`rdd.partitioner` ever be different from one of the shuffle dependencies 
partitioner?  i thought shuffle dependencies always have to have the same 
partitioner?
    (if there is a good reason, probably need a comment in the code)
    
    (b) if this is needed, can probably just be `partitioner == 
dep.partitioner` -- that is simpler, equivalent for `HashPartitioner`, and 
allows it to still work for other partitioners as well.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to