Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/469#discussion_r11877333
--- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
@@ -236,6 +236,21 @@ abstract class RDD[T: ClassTag](
}
/**
+ * Return the ancestors of the given RDD that are related to it only
through a sequence of
+ * narrow dependencies. This traverses the given RDD's dependency tree
using DFS.
+ */
+ private[spark] def getNarrowAncestors(
+ ancestors: ArrayBuffer[RDD[_]] = ArrayBuffer.empty): Seq[RDD[_]] = {
+ val narrowDependencies = dependencies.collect { case d:
NarrowDependency[_] => d }
+ val narrowParents = narrowDependencies.map(_.rdd)
+ narrowParents.foreach { parent =>
+ ancestors += parent
--- End diff --
`rdd.union(rdd)` actually does not produce a cycle. The resulting tree has
a root `UnionRDD` and two identical children `rdd`.
---
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.
---