File tree Expand file tree Collapse file tree 2 files changed +4
-22
lines changed
sql/core/src/test/scala/org/apache/spark/sql/execution Expand file tree Collapse file tree 2 files changed +4
-22
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ import org.apache.spark.sql.catalyst.dsl.expressions._
21
21
22
22
class SortSuite extends SparkPlanTest {
23
23
24
+ // This test was originally added as an example of how to use [[SparkPlanTest]];
25
+ // it's not designed to be a comprehensive test of ExternalSort.
24
26
test(" basic sorting using ExternalSort" ) {
25
27
26
28
val input = Seq (
Original file line number Diff line number Diff line change @@ -77,25 +77,6 @@ class SparkPlanTest extends SparkFunSuite {
77
77
case None =>
78
78
}
79
79
}
80
-
81
- /**
82
- * Runs the plan and makes sure the answer matches the expected result.
83
- * @param input the input data to be used.
84
- * @param planFunction a function which accepts the input SparkPlan and uses it to instantiate
85
- * the physical operator that's being tested.
86
- * @param expectedAnswer the expected result in a [[Seq ]] of [[Product ]]s.
87
- */
88
- protected def checkAnswer [A <: Product : TypeTag ](
89
- input : Seq [A ],
90
- planFunction : SparkPlan => SparkPlan ,
91
- expectedAnswer : Seq [A ]): Unit = {
92
- val inputDf = TestSQLContext .createDataFrame(input)
93
- val expectedRows = expectedAnswer.map(Row .fromTuple)
94
- SparkPlanTest .checkAnswer(inputDf, planFunction, expectedRows) match {
95
- case Some (errorMessage) => fail(errorMessage)
96
- case None =>
97
- }
98
- }
99
80
}
100
81
101
82
/**
@@ -128,9 +109,8 @@ object SparkPlanTest {
128
109
129
110
plan.transformExpressions {
130
111
case UnresolvedAttribute (Seq (u)) =>
131
- inputMap.get(u).getOrElse {
132
- sys.error(s " Invalid Test: Cannot resolve $u given input ${inputMap}" )
133
- }
112
+ inputMap.getOrElse(u,
113
+ sys.error(s " Invalid Test: Cannot resolve $u given input $inputMap" ))
134
114
}
135
115
}
136
116
You can’t perform that action at this time.
0 commit comments