Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
LantaoJin committed Jul 16, 2020
1 parent 7465bfa commit 0950e9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,7 @@ case class OptimizeSkewedJoin(conf: SQLConf) extends Rule[SparkPlan] {
* 3 tasks separately.
*/
def optimizeSkewJoin(plan: SparkPlan): SparkPlan = plan.transformUp {
case smj @ SortMergeJoinExec(_, _, joinType, _,
s1 @ SortExec(_, _, _, _),
s2 @ SortExec(_, _, _, _), _)
case smj @ SortMergeJoinExec(_, _, joinType, _, s1: SortExec, s2: SortExec, _)
if supportedJoinTypes.contains(joinType) =>
// find the shuffleStage from the plan tree
val leftOpt = findShuffleStage(s1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,9 @@ class AdaptiveQueryExecSuite

checkSkewJoin(
"SELECT key1 FROM skewData1 JOIN skewData2 ON key1 = key2", true)
// Additional shuffle introduced, so disable the "OptimizeSkewedJoin" optimization
// After patched SPARK-32201, this query won't introduce additional shuffle anymore.
checkSkewJoin(
"SELECT key1 FROM skewData1 JOIN skewData2 ON key1 = key2 GROUP BY key1", false)
"SELECT key1 FROM skewData1 JOIN skewData2 ON key1 = key2 GROUP BY key1", true)
}
}
}
Expand Down

0 comments on commit 0950e9a

Please sign in to comment.