manuzhang commented on a change in pull request #28916:
URL: https://github.com/apache/spark/pull/28916#discussion_r444771131



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/ShufflePartitionsUtil.scala
##########
@@ -92,9 +92,10 @@ object ShufflePartitionsUtil extends Logging {
     var coalescedSize = 0L
     var i = 0
 
-    def createPartitionSpec(): Unit = {
-      // Skip empty inputs, as it is a waste to launch an empty task.
-      if (coalescedSize > 0) {
+    def createPartitionSpec(last: Boolean = false): Unit = {
+      // Skip empty inputs, as it is a waste to launch an empty task
+      // unless all inputs are empty
+      if (coalescedSize > 0 || (last && partitionSpecs.isEmpty)) {

Review comment:
       Yes, one partition if all partitions are empty. This creates one 
partition spec at last when no partition specs have been created.




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

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