ulysses-you commented on PR #34785:
URL: https://github.com/apache/spark/pull/34785#issuecomment-1132397474
Looks correct to me. BTW, after Spark3.3 the RebalancePartitions supports
specify the initialNumPartition, so the demo code can be:
```scala
val optNumPartitions = if (numPartitions == 0) None else Some(numPartitions)
if (!write.distributionStrictlyRequired()) {
RebalancePartitions(distribution, query, optNumPartitions)
} else {
RepartitionByExpression(distribution, query, optNumPartitions)
}
```
--
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]