rekbun commented on code in PR #60256:
URL: https://github.com/apache/spark/pull/60256#discussion_r4601387113


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/GroupPartitionsExec.scala:
##########
@@ -863,30 +865,33 @@ private[sql] object GroupPartitionsExec {
  *
  * Unlike Spark's default coalescer which tries to minimize data movement, 
this coalescer
  * groups partitions based on their partition keys to maintain the grouping 
semantics
- * required for storage-partitioned operations.
+ * required for storage-partitioned operations. Each group prefers the host 
that most of its
+ * partitions prefer.
  *
  * @param groupedPartitions Sequence where each element is a sequence of input 
partition
- *                         indices that should be grouped together
+ *                         indices that should be grouped together. Only the 
driver reads it,
+ *                         so it is not serialized into tasks.
  */
 class GroupedPartitionCoalescer(
-    val groupedPartitions: Seq[Seq[Int]]
+    @transient val groupedPartitions: Seq[Seq[Int]]
   ) extends PartitionCoalescer with Serializable {
 
   override def coalesce(maxPartitions: Int, parent: RDD[_]): 
Array[PartitionGroup] = {

Review Comment:
   Thanks for the sketch. Finding 5 already leaves cached data and groups of 
one to the scheduler, which covers the locality this PR had lost. The subclass 
would also need a `SortedMergeCoalescedRDD` version and would vote at every 
stage submission. What it adds on top is the zip of a group of one with a 
larger group, and offering every tied host. I'd prefer to keep this PR to the 
coalescer. Would a follow-up for that work for you, if it turns out to matter?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to