Github user JoshRosen commented on a diff in the pull request: https://github.com/apache/spark/pull/3633#discussion_r21563663 --- Diff: core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala --- @@ -341,8 +342,11 @@ private[spark] class PartitionCoalescer(maxPartitions: Int, prev: RDD[_], balanc } } -private[spark] case class PartitionGroup(prefLoc: String = "") { +private case class PartitionGroup(prefLoc: Option[String] = None) { var arr = mutable.ArrayBuffer[Partition]() - def size = arr.size } + +private object PartitionGroup { + def apply(prefLoc: String): PartitionGroup = PartitionGroup(Some(prefLoc)) --- End diff -- Is this for backwards-compatibility? Can you have a case class with multiple constructors? If so, it might be nice to just add this to the `PartitionGroup` class as a secondary constructor. Also, what do you think about adding a `require(prefLoc != "")` to guard against code that uses the old empty string technique?
--- 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