Github user srowen commented on a diff in the pull request: https://github.com/apache/spark/pull/5679#discussion_r29041189 --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala --- @@ -1055,7 +1055,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli /** Build the union of a list of RDDs. */ def union[T: ClassTag](rdds: Seq[RDD[T]]): RDD[T] = { val partitioners = rdds.flatMap(_.partitioner).toSet - if (partitioners.size == 1) { + if (rdds.forall(_.partitioner.isDefined) && partitioners.size == 1) { --- End diff -- Yeah I like this. I suppose that the pre-existing condition already caught the empty RDD case, which `PartitionerAwareUnionRDD` will reject. Although symmetry between this check and the following one would be nice I don't think it's important. This looks correct since clearly `PartitionerAwareUnionRDD` intends to operate only on RDDs with partitioners.
--- 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