szehon-ho commented on code in PR #47426: URL: https://github.com/apache/spark/pull/47426#discussion_r1706121389
########## 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: Yes you may be right, let me double check this with a test and get back to you. -- 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