Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/17936#discussion_r117429928 --- Diff: core/src/main/scala/org/apache/spark/rdd/CartesianRDD.scala --- @@ -71,9 +72,92 @@ class CartesianRDD[T: ClassTag, U: ClassTag]( } override def compute(split: Partition, context: TaskContext): Iterator[(T, U)] = { + val blockManager = SparkEnv.get.blockManager val currSplit = split.asInstanceOf[CartesianPartition] - for (x <- rdd1.iterator(currSplit.s1, context); - y <- rdd2.iterator(currSplit.s2, context)) yield (x, y) + val blockId2 = RDDBlockId(rdd2.id, currSplit.s2.index) + var cachedInLocal = false + var holdReadLock = false + + // Try to get data from the local, otherwise it will be cached to the local. + def getOrElseCache( --- End diff -- Btw, can we move those functions out of `compute`? Too many nested functions here and making `compute` too big.
--- 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