Skip to content

Commit ff8b94e

Browse files
c21dongjoon-hyun
authored andcommitted
[SPARK-34711][SQL][TESTS] Exercise code-gen enable/disable code paths for SHJ in join test suites
### What changes were proposed in this pull request? Per comment in #31802 (comment) , we would like to exercise whole stage code-gen enabled and disabled code paths in join unit test suites. This is for better test coverage of shuffled hash join. ### Why are the changes needed? Better test coverage. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing and added unit tests here. Closes #31806 from c21/test-minor. Authored-by: Cheng Su <chengsu@fb.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com> (cherry picked from commit 9aa8f06) Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
1 parent 4b38935 commit ff8b94e

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

sql/core/src/test/scala/org/apache/spark/sql/execution/joins/ExistenceJoinSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession {
103103
ProjectExec(output, FilterExec(condition, join))
104104
}
105105

106-
test(s"$testName using ShuffledHashJoin") {
106+
testWithWholeStageCodegenOnAndOff(s"$testName using ShuffledHashJoin") { _ =>
107107
extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) =>
108108
withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") {
109109
checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) =>

sql/core/src/test/scala/org/apache/spark/sql/execution/joins/InnerJoinSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class InnerJoinSuite extends SparkPlanTest with SharedSparkSession {
153153
}
154154
}
155155

156-
test(s"$testName using ShuffledHashJoin (build=left)") {
156+
testWithWholeStageCodegenOnAndOff(s"$testName using ShuffledHashJoin (build=left)") { _ =>
157157
extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) =>
158158
withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") {
159159
checkAnswer2(leftRows, rightRows, (leftPlan: SparkPlan, rightPlan: SparkPlan) =>
@@ -165,7 +165,7 @@ class InnerJoinSuite extends SparkPlanTest with SharedSparkSession {
165165
}
166166
}
167167

168-
test(s"$testName using ShuffledHashJoin (build=right)") {
168+
testWithWholeStageCodegenOnAndOff(s"$testName using ShuffledHashJoin (build=right)") { _ =>
169169
extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) =>
170170
withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") {
171171
checkAnswer2(leftRows, rightRows, (leftPlan: SparkPlan, rightPlan: SparkPlan) =>

sql/core/src/test/scala/org/apache/spark/sql/execution/joins/OuterJoinSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class OuterJoinSuite extends SparkPlanTest with SharedSparkSession {
104104
ExtractEquiJoinKeys.unapply(join)
105105
}
106106

107-
test(s"$testName using ShuffledHashJoin") {
107+
testWithWholeStageCodegenOnAndOff(s"$testName using ShuffledHashJoin") { _ =>
108108
extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) =>
109109
withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") {
110110
val buildSide = if (joinType == LeftOuter) BuildRight else BuildLeft

0 commit comments

Comments
 (0)