peter-toth commented on code in PR #54335:
URL: https://github.com/apache/spark/pull/54335#discussion_r2815740806


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:
##########
@@ -72,10 +72,11 @@ case class BroadcastHashJoinExec private(
   override lazy val outputPartitioning: Partitioning = {
     joinType match {
       case _: InnerLike if conf.broadcastHashJoinOutputPartitioningExpandLimit 
> 0 =>
-        streamedPlan.outputPartitioning match {
-          case h: HashPartitioningLike => expandOutputPartitioning(h)
-          case c: PartitioningCollection => expandOutputPartitioning(c)
-          case other => other
+        val expandedPartitioning = 
expandOutputPartitioning(streamedPlan.outputPartitioning)
+        expandedPartitioning match {
+          case Nil => 
UnknownPartitioning(streamedPlan.outputPartitioning.numPartitions)

Review Comment:
   Thanks for pointing this out. I added a comment in 
https://github.com/apache/spark/pull/54335/commits/3d75c6b3a4399621afe52bc425a3112d14b5568a.
 This could only happen if there was an empty `PartitioningCollection` in 
`streamedPlan.outputPartitioning`. `UnknownPartitioning` is always a valid 
alternative as it satisfies only distributions with the lowest requirements.



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