viirya commented on code in PR #54335:
URL: https://github.com/apache/spark/pull/54335#discussion_r2826410019
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:
##########
@@ -72,10 +72,15 @@ 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 =>
+ // This could only happen if `streamedPlan.outputPartitioning` was
an empty
+ // `PartitioningCollection`, but in that case
`UnknownPartitioning` is always a valid
+ // alternative.
+ UnknownPartitioning(streamedPlan.outputPartitioning.numPartitions)
Review Comment:
In PartitioningCollection's constructor:
```scala
require(
partitionings.map(_.numPartitions).distinct.length == 1,
s"PartitioningCollection requires all of its partitionings have the same
numPartitions.")
```
An empty `PartitioningCollection` would fail that `require`. So the `Nil`
branch can never be reached, isn't?
--
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]