metanil commented on code in PR #59760:
URL: https://github.com/apache/spark/pull/59760#discussion_r4545834723


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala:
##########
@@ -1899,6 +1902,17 @@ trait LeafShuffleSpec extends ShuffleSpec {
   def createPartitioning(clustering: Seq[Expression]): Partitioning =
     throw SparkUnsupportedOperationException()
 
+  /**
+   * Whether Spark can evaluate the partitioning [[createPartitioning]] 
builds, to place the rows
+   * of a child shuffled onto this layout. [[canCreatePartitioning]] does not 
ask it, since a child
+   * that pairs with this layout as it stands evaluates nothing. A caller that 
shuffles a child onto
+   * this layout has to ask it too. Only a [[KeyedShuffleSpec]] can answer 
false, and its
+   * [[createPartitioning]] asserts it, so a caller that does not ask fails 
while planning. What it
+   * builds over a Pandas or Arrow cogroup child's key of another type can 
still be one Spark

Review Comment:
   This is a good one. Thanks for catching it!
   Confirmed: `SparkConnectPlanner` builds `CoGroup` with its constructor, 
which skips the `require`. All five places now say "a cogroup that does not 
coerce its keys, e.g. a Pandas or Arrow cogroup", the `LeafShuffleSpec` copy 
ends with "fails while planning too, see `createPartitioning`", and the 
description mentions Connect too. I'll add a note to SPARK-60782 as well, since 
its title names only Pandas and Arrow.



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