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

    https://github.com/apache/spark/pull/15077#discussion_r78549808
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -795,7 +795,7 @@ class SparkContext(config: SparkConf) extends Logging 
with ExecutorAllocationCli
       def makeRDD[T: ClassTag](seq: Seq[(T, Seq[String])]): RDD[T] = withScope 
{
         assertNotStopped()
         val indexToPrefs = seq.zipWithIndex.map(t => (t._2, t._1._2)).toMap
    -    new ParallelCollectionRDD[T](this, seq.map(_._1), seq.size, 
indexToPrefs)
    +    new ParallelCollectionRDD[T](this, seq.map(_._1), math.max(seq.size, 
defaultParallelism), indexToPrefs)
    --- End diff --
    
    I would say `math.max(seq.size, 1)`. Really this method would normally just 
use the provided partition count (called "numSlices" in this old API) but this 
one doesn't have that parameter, which is more reason it's an odd man out. 
Still I think the most reasonable behavior is to use at least 1 partition.


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

Reply via email to