Skip to content

Commit

Permalink
Refactor apply method in InsertMapSortInRepartitionExpressions
Browse files Browse the repository at this point in the history
  • Loading branch information
ostronaut committed Jan 7, 2025
1 parent 75e323b commit d6592d2
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ object InsertMapSortInRepartitionExpressions extends Rule[LogicalPlan] {
override def apply(plan: LogicalPlan): LogicalPlan = {
plan.transformUpWithPruning(_.containsPattern(REPARTITION_OPERATION)) {
case rep @
RepartitionByExpression(partitionExprs, child, optNumPartitions, optAdvisoryPartitionSize)
RepartitionByExpression(partitionExprs, _, _, _)
if rep.partitionExpressions.exists(mapTypeExistsRecursively) =>
val exprToMapSort = new mutable.HashMap[Expression, Expression]
val newPartitionExprs = partitionExprs.map { expr =>
Expand All @@ -101,9 +101,7 @@ object InsertMapSortInRepartitionExpressions extends Rule[LogicalPlan] {
expr
}
}
RepartitionByExpression(
newPartitionExprs, child, optNumPartitions, optAdvisoryPartitionSize
)
rep.copy(partitionExpressions = newPartitionExprs)
}
}
}
Expand Down

0 comments on commit d6592d2

Please sign in to comment.