andygrove commented on a change in pull request #33910:
URL: https://github.com/apache/spark/pull/33910#discussion_r702451785



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEShuffleReadExec.scala
##########
@@ -82,8 +82,11 @@ case class AQEShuffleReadExec private(
         // `RoundRobinPartitioning` but we don't need to retain the number of 
partitions.
         case r: RoundRobinPartitioning =>
           r.copy(numPartitions = partitionSpecs.length)
-        case other => throw new IllegalStateException(
-          "Unexpected partitioning for coalesced shuffle read: " + other)
+        case _ =>
+          // Spark plugins may have custom partitioning and may replace this 
operator
+          // during the postStageOptimization phase, so return 
UnknownPartitioning here
+          // rather than throw an exception
+          UnknownPartitioning(partitionSpecs.length)

Review comment:
       Another option here would be to introduce some new traits such as 
`HashPartitioningLike`, as we did with `ShuffleExchangeLike` and 
`BroadcastExchangeLike` so that plugins can use custom partitioning 
implementations that Spark can still work with. I will put up an alternate PR 
using that approach in the next day or two.




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