viirya commented on code in PR #43729:
URL: https://github.com/apache/spark/pull/43729#discussion_r1388441032
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala:
##########
@@ -661,6 +690,26 @@ case class HashShuffleSpec(
override def numPartitions: Int = partitioning.numPartitions
}
+case class CoalescedHashShuffleSpec(
+ from: ShuffleSpec,
+ partitions: Seq[CoalescedBoundary]) extends ShuffleSpec {
+
+ override def isCompatibleWith(other: ShuffleSpec): Boolean = other match {
+ case SinglePartitionShuffleSpec =>
+ numPartitions == 1
+ case CoalescedHashShuffleSpec(otherParent, otherPartitions) =>
+ partitions == otherPartitions && from.isCompatibleWith(otherParent)
Review Comment:
Hmm, if first hash partitioning is 5 partitions, second is 4 partitions. How
can we get same coalesced partitions with that?
For example:
[[0, 3], [3, 5]] != [[0, 3], [3, 4]]
[[0, 2], [2, 3], [3, 5]] != [[0, 2], [2, 3], [3, 4]]
The end reducer index of last coalesced partition should be different
always, no?
--
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]