@@ -54,7 +54,7 @@ class SparkPlanTest extends SparkFunSuite {
5454 planFunction : SparkPlan => SparkPlan ,
5555 expectedAnswer : Seq [Row ],
5656 sortAnswers : Boolean = true ): Unit = {
57- checkAnswer (
57+ doCheckAnswer (
5858 input :: Nil ,
5959 (plans : Seq [SparkPlan ]) => planFunction(plans.head),
6060 expectedAnswer,
@@ -71,13 +71,13 @@ class SparkPlanTest extends SparkFunSuite {
7171 * @param sortAnswers if true, the answers will be sorted by their toString representations prior
7272 * to being compared.
7373 */
74- protected def checkAnswer (
74+ protected def checkAnswer2 (
7575 left : DataFrame ,
7676 right : DataFrame ,
7777 planFunction : (SparkPlan , SparkPlan ) => SparkPlan ,
7878 expectedAnswer : Seq [Row ],
7979 sortAnswers : Boolean = true ): Unit = {
80- checkAnswer (
80+ doCheckAnswer (
8181 left :: right :: Nil ,
8282 (plans : Seq [SparkPlan ]) => planFunction(plans(0 ), plans(1 )),
8383 expectedAnswer,
@@ -87,13 +87,13 @@ class SparkPlanTest extends SparkFunSuite {
8787 /**
8888 * Runs the plan and makes sure the answer matches the expected result.
8989 * @param input the input data to be used.
90- * @param planFunction a function which accepts the input SparkPlan and uses it to instantiate
91- * the physical operator that's being tested.
90+ * @param planFunction a function which accepts a sequence of input SparkPlans and uses them to
91+ * instantiate the physical operator that's being tested.
9292 * @param expectedAnswer the expected result in a [[Seq ]] of [[Row ]]s.
9393 * @param sortAnswers if true, the answers will be sorted by their toString representations prior
9494 * to being compared.
9595 */
96- protected def checkAnswer (
96+ protected def doCheckAnswer (
9797 input : Seq [DataFrame ],
9898 planFunction : Seq [SparkPlan ] => SparkPlan ,
9999 expectedAnswer : Seq [Row ],
@@ -104,62 +104,6 @@ class SparkPlanTest extends SparkFunSuite {
104104 }
105105 }
106106
107- /**
108- * Runs the plan and makes sure the answer matches the expected result.
109- * @param input the input data to be used.
110- * @param planFunction a function which accepts the input SparkPlan and uses it to instantiate
111- * the physical operator that's being tested.
112- * @param expectedAnswer the expected result in a [[Seq ]] of [[Product ]]s.
113- * @param sortAnswers if true, the answers will be sorted by their toString representations prior
114- * to being compared.
115- */
116- protected def checkAnswer [A <: Product : TypeTag ](
117- input : DataFrame ,
118- planFunction : SparkPlan => SparkPlan ,
119- expectedAnswer : Seq [A ],
120- sortAnswers : Boolean = true ): Unit = {
121- val expectedRows = expectedAnswer.map(Row .fromTuple)
122- checkAnswer(input, planFunction, expectedRows, sortAnswers)
123- }
124-
125- /**
126- * Runs the plan and makes sure the answer matches the expected result.
127- * @param left the left input data to be used.
128- * @param right the right input data to be used.
129- * @param planFunction a function which accepts the input SparkPlan and uses it to instantiate
130- * the physical operator that's being tested.
131- * @param expectedAnswer the expected result in a [[Seq ]] of [[Product ]]s.
132- * @param sortAnswers if true, the answers will be sorted by their toString representations prior
133- * to being compared.
134- */
135- protected def checkAnswer [A <: Product : TypeTag ](
136- left : DataFrame ,
137- right : DataFrame ,
138- planFunction : (SparkPlan , SparkPlan ) => SparkPlan ,
139- expectedAnswer : Seq [A ],
140- sortAnswers : Boolean = true ): Unit = {
141- val expectedRows = expectedAnswer.map(Row .fromTuple)
142- checkAnswer(left, right, planFunction, expectedRows, sortAnswers)
143- }
144-
145- /**
146- * Runs the plan and makes sure the answer matches the expected result.
147- * @param input the input data to be used.
148- * @param planFunction a function which accepts the input SparkPlan and uses it to instantiate
149- * the physical operator that's being tested.
150- * @param expectedAnswer the expected result in a [[Seq ]] of [[Product ]]s.
151- * @param sortAnswers if true, the answers will be sorted by their toString representations prior
152- * to being compared.
153- */
154- protected def checkAnswer [A <: Product : TypeTag ](
155- input : Seq [DataFrame ],
156- planFunction : Seq [SparkPlan ] => SparkPlan ,
157- expectedAnswer : Seq [A ],
158- sortAnswers : Boolean = true ): Unit = {
159- val expectedRows = expectedAnswer.map(Row .fromTuple)
160- checkAnswer(input, planFunction, expectedRows, sortAnswers)
161- }
162-
163107 /**
164108 * Runs the plan and makes sure the answer matches the result produced by a reference plan.
165109 * @param input the input data to be used.
@@ -172,7 +116,7 @@ class SparkPlanTest extends SparkFunSuite {
172116 * @param sortAnswers if true, the answers will be sorted by their toString representations prior
173117 * to being compared.
174118 */
175- protected def checkAnswer (
119+ protected def checkThatPlansAgree (
176120 input : DataFrame ,
177121 planFunction : SparkPlan => SparkPlan ,
178122 expectedPlanFunction : SparkPlan => SparkPlan ,
0 commit comments