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

    https://github.com/apache/spark/pull/962#discussion_r14310217
  
    --- Diff: 
core/src/main/scala/org/apache/spark/rdd/ParallelCollectionRDD.scala ---
    @@ -99,7 +100,14 @@ private[spark] class ParallelCollectionRDD[T: ClassTag](
       }
     
       override def compute(s: Partition, context: TaskContext) = {
    -    new InterruptibleIterator(context, 
s.asInstanceOf[ParallelCollectionPartition[T]].iterator)
    +    val parallelCollectionsPartition = 
s.asInstanceOf[ParallelCollectionPartition[T]]
    +
    +    // Set the input metrics for the task.
    +    val inputMetrics = new InputMetrics(DataReadMethod.Memory)
    +    inputMetrics.bytesRead = 
SizeEstimator.estimate(parallelCollectionsPartition.values)
    --- End diff --
    
    There are a few issues with this.
    
    1. This might be a bit confusing for users.
    2. I think calling parallelCollectionsPartition.values will materialize the 
entire input partition in memory, rather than iterating through it. This could 
e.g. cause an OOM in cases whether otherwise the input would be streamed 
through.
    3. The size estimation here is expensive.
    
    So overall I'd support just removing this.


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