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

    https://github.com/apache/spark/pull/17898#discussion_r115269762
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/CartesianRDD.scala ---
    @@ -72,8 +72,10 @@ class CartesianRDD[T: ClassTag, U: ClassTag](
     
       override def compute(split: Partition, context: TaskContext): 
Iterator[(T, U)] = {
         val currSplit = split.asInstanceOf[CartesianPartition]
    -    for (x <- rdd1.iterator(currSplit.s1, context);
    -         y <- rdd2.iterator(currSplit.s2, context)) yield (x, y)
    +    val groupSize = 500;
    +    for (x <- rdd1.iterator(currSplit.s1, context).grouped(groupSize);
    +         y <- rdd2.iterator(currSplit.s2, context).grouped(groupSize);
    --- End diff --
    
    Oh haha right. Hm, but isn't this better solved 'upstream' by buffering an 
iterator somewhere? or just buffering the iterator right here?


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