Skip to content

Commit 35dad9f

Browse files
committed
Make sortAnswers = false the default in SparkPlanTest
1 parent 5135200 commit 35dad9f

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanTest.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class SparkPlanTest extends SparkFunSuite {
5353
input: DataFrame,
5454
planFunction: SparkPlan => SparkPlan,
5555
expectedAnswer: Seq[Row],
56-
sortAnswers: Boolean): Unit = {
56+
sortAnswers: Boolean = true): Unit = {
5757
checkAnswer(
5858
input :: Nil,
5959
(plans: Seq[SparkPlan]) => planFunction(plans.head),
@@ -76,7 +76,7 @@ class SparkPlanTest extends SparkFunSuite {
7676
right: DataFrame,
7777
planFunction: (SparkPlan, SparkPlan) => SparkPlan,
7878
expectedAnswer: Seq[Row],
79-
sortAnswers: Boolean): Unit = {
79+
sortAnswers: Boolean = true): Unit = {
8080
checkAnswer(
8181
left :: right :: Nil,
8282
(plans: Seq[SparkPlan]) => planFunction(plans(0), plans(1)),
@@ -97,7 +97,7 @@ class SparkPlanTest extends SparkFunSuite {
9797
input: Seq[DataFrame],
9898
planFunction: Seq[SparkPlan] => SparkPlan,
9999
expectedAnswer: Seq[Row],
100-
sortAnswers: Boolean): Unit = {
100+
sortAnswers: Boolean = true): Unit = {
101101
SparkPlanTest.checkAnswer(input, planFunction, expectedAnswer, sortAnswers) match {
102102
case Some(errorMessage) => fail(errorMessage)
103103
case None =>
@@ -117,7 +117,7 @@ class SparkPlanTest extends SparkFunSuite {
117117
input: DataFrame,
118118
planFunction: SparkPlan => SparkPlan,
119119
expectedAnswer: Seq[A],
120-
sortAnswers: Boolean): Unit = {
120+
sortAnswers: Boolean = true): Unit = {
121121
val expectedRows = expectedAnswer.map(Row.fromTuple)
122122
checkAnswer(input, planFunction, expectedRows, sortAnswers)
123123
}
@@ -137,7 +137,7 @@ class SparkPlanTest extends SparkFunSuite {
137137
right: DataFrame,
138138
planFunction: (SparkPlan, SparkPlan) => SparkPlan,
139139
expectedAnswer: Seq[A],
140-
sortAnswers: Boolean): Unit = {
140+
sortAnswers: Boolean = true): Unit = {
141141
val expectedRows = expectedAnswer.map(Row.fromTuple)
142142
checkAnswer(left, right, planFunction, expectedRows, sortAnswers)
143143
}
@@ -155,7 +155,7 @@ class SparkPlanTest extends SparkFunSuite {
155155
input: Seq[DataFrame],
156156
planFunction: Seq[SparkPlan] => SparkPlan,
157157
expectedAnswer: Seq[A],
158-
sortAnswers: Boolean): Unit = {
158+
sortAnswers: Boolean = true): Unit = {
159159
val expectedRows = expectedAnswer.map(Row.fromTuple)
160160
checkAnswer(input, planFunction, expectedRows, sortAnswers)
161161
}
@@ -176,7 +176,7 @@ class SparkPlanTest extends SparkFunSuite {
176176
input: DataFrame,
177177
planFunction: SparkPlan => SparkPlan,
178178
expectedPlanFunction: SparkPlan => SparkPlan,
179-
sortAnswers: Boolean): Unit = {
179+
sortAnswers: Boolean = true): Unit = {
180180
SparkPlanTest.checkAnswer(input, planFunction, expectedPlanFunction, sortAnswers) match {
181181
case Some(errorMessage) => fail(errorMessage)
182182
case None =>

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,15 @@ class OuterJoinSuite extends SparkPlanTest {
4747
(1, 2.0, null, null),
4848
(2, 1.0, 2, 3.0),
4949
(3, 3.0, null, null)
50-
),
51-
sortAnswers = true)
50+
))
5251

5352
checkAnswer(left, right, (left: SparkPlan, right: SparkPlan) =>
5453
ShuffledHashOuterJoin(leftKeys, rightKeys, RightOuter, condition, left, right),
5554
Seq(
5655
(2, 1.0, 2, 3.0),
5756
(null, null, 3, 2.0),
5857
(null, null, 4, 1.0)
59-
),
60-
sortAnswers = true)
58+
))
6159

6260
checkAnswer(left, right, (left: SparkPlan, right: SparkPlan) =>
6361
ShuffledHashOuterJoin(leftKeys, rightKeys, FullOuter, condition, left, right),
@@ -67,8 +65,7 @@ class OuterJoinSuite extends SparkPlanTest {
6765
(3, 3.0, null, null),
6866
(null, null, 3, 2.0),
6967
(null, null, 4, 1.0)
70-
),
71-
sortAnswers = true)
68+
))
7269
}
7370

7471
test("broadcast hash outer join") {
@@ -78,16 +75,14 @@ class OuterJoinSuite extends SparkPlanTest {
7875
(1, 2.0, null, null),
7976
(2, 1.0, 2, 3.0),
8077
(3, 3.0, null, null)
81-
),
82-
sortAnswers = true)
78+
))
8379

8480
checkAnswer(left, right, (left: SparkPlan, right: SparkPlan) =>
8581
BroadcastHashOuterJoin(leftKeys, rightKeys, RightOuter, condition, left, right),
8682
Seq(
8783
(2, 1.0, 2, 3.0),
8884
(null, null, 3, 2.0),
8985
(null, null, 4, 1.0)
90-
),
91-
sortAnswers = true)
86+
))
9287
}
9388
}

0 commit comments

Comments
 (0)