ulysses-you commented on code in PR #41609:
URL: https://github.com/apache/spark/pull/41609#discussion_r1272923633
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewInRebalancePartitions.scala:
##########
@@ -39,34 +39,6 @@ object OptimizeSkewInRebalancePartitions extends
AQEShuffleReadRule {
override val supportedShuffleOrigins: Seq[ShuffleOrigin] =
Seq(REBALANCE_PARTITIONS_BY_NONE, REBALANCE_PARTITIONS_BY_COL)
- /**
- * Splits the skewed partition based on the map size and the target
partition size
- * after split. Create a list of `PartialReducerPartitionSpec` for skewed
partition and
- * create `CoalescedPartition` for normal partition.
- */
- private def optimizeSkewedPartitions(
- shuffleId: Int,
- bytesByPartitionId: Array[Long],
- targetSize: Long): Seq[ShufflePartitionSpec] = {
- val smallPartitionFactor =
-
conf.getConf(SQLConf.ADAPTIVE_REBALANCE_PARTITIONS_SMALL_PARTITION_FACTOR)
- bytesByPartitionId.indices.flatMap { reduceIndex =>
- val bytes = bytesByPartitionId(reduceIndex)
- if (bytes > targetSize) {
- val newPartitionSpec = ShufflePartitionsUtil.createSkewPartitionSpecs(
- shuffleId, reduceIndex, targetSize, smallPartitionFactor)
- if (newPartitionSpec.isEmpty) {
- CoalescedPartitionSpec(reduceIndex, reduceIndex + 1, bytes) :: Nil
- } else {
- logDebug(s"For shuffle $shuffleId, partition $reduceIndex is skew, "
+
- s"split it into ${newPartitionSpec.get.size} parts.")
- newPartitionSpec.get
- }
- } else {
- CoalescedPartitionSpec(reduceIndex, reduceIndex + 1, bytes) :: Nil
- }
- }
- }
Review Comment:
Seems we can remove one more line
--
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]