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

    https://github.com/apache/spark/pull/1418#discussion_r15436180
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala 
---
    @@ -275,18 +286,48 @@ class DAGScheduler(
                 case shufDep: ShuffleDependency[_, _, _] =>
                   parents += getShuffleMapStage(shufDep, jobId)
                 case _ =>
    -              visit(dep.rdd)
    +              waitingForVisit.push(dep.rdd)
               }
             }
           }
         }
    -    visit(rdd)
    +    waitingForVisit.push(rdd)
    +    while (!waitingForVisit.isEmpty)
    +      visit(waitingForVisit.pop())
         parents.toList
       }
     
    +  private def getParentShuffleDependencies(rdd: RDD[_]): 
Stack[ShuffleDependency[_, _, _]] = {
    +    val parents = new Stack[ShuffleDependency[_, _, _]]
    +    val visited = new HashSet[RDD[_]]
    +    val waitingForVisit = new Stack[RDD[_]]
    +    def visit(r: RDD[_]) {
    +      if (!visited(r)) {
    +        visited += r
    +        for (dep <- r.dependencies) {
    +          dep match {
    +            case shufDep: ShuffleDependency[_, _, _] =>
    +              if (!shuffleToMapStage.contains(shufDep.shuffleId))
    --- End diff --
    
    This should have braces around the if statement's body


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