mbutrovich commented on code in PR #2258:
URL: https://github.com/apache/datafusion-comet/pull/2258#discussion_r2376419055


##########
spark/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/CometNativeShuffleWriter.scala:
##########
@@ -140,6 +142,22 @@ class CometNativeShuffleWriter[K, V](
       MapStatus.apply(SparkEnv.get.blockManager.shuffleServerId, 
partitionLengths, mapId)
   }
 
+  private def isSinglePartitioning(p: Partitioning): Boolean = p match {
+    case SinglePartition => true
+    case rp: RangePartitioning =>
+      // Spark sometimes generates RangePartitioning schemes with 
numPartitions == 1,
+      // or the computed bounds results in a single target partition.
+      // In this case Comet just serializes a SinglePartition scheme to native.
+      if ((rp.numPartitions == 1) || rangePartitionBounds.isEmpty ||
+        rangePartitionBounds.get.isEmpty) {
+        true
+      } else {
+        false
+      }

Review Comment:
   Thanks @comphead!



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