viirya commented on code in PR #47426:
URL: https://github.com/apache/spark/pull/47426#discussion_r1704570702


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala:
##########
@@ -429,8 +429,19 @@ case class EnsureRequirements(
         // expressions
         val partitionExprs = leftSpec.partitioning.expressions
 
-        var mergedPartValues = InternalRowComparableWrapper
-            .mergePartitions(leftSpec.partitioning, rightSpec.partitioning, 
partitionExprs)
+        // in case of compatible but not identical partition expressions, we 
apply 'reduce'
+        // transforms to group one side's partitions as well as the common 
partition values
+        val leftReducers = leftSpec.reducers(rightSpec)
+        val leftParts = reducePartValues(leftSpec.partitioning.partitionValues,
+          partitionExprs,
+          leftReducers)
+        val rightReducers = rightSpec.reducers(leftSpec)
+        val rightParts = 
reducePartValues(rightSpec.partitioning.partitionValues,
+          partitionExprs,

Review Comment:
   `partitionExprs` are from left spec. As this goes to reduce on right spec. 
Does it guarantee that right spec's partition expressions have same data types 
as left spec?



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to