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

    https://github.com/apache/spark/pull/3633#discussion_r21565917
  
    --- 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 --
    
    This is mainly because you can instantiate case classes without the `new` 
keyword. In fact this is how we instantiate this particular class in this file. 
Adding a new constructor means we need to use the `new` keyword to instantiate 
it, and I believe many users of case classes don't actually do that.
    
    Yeah I'll add the guard against empty string.


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