Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/7162#discussion_r33703139
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanTest.scala ---
@@ -68,15 +99,45 @@ class SparkPlanTest extends SparkFunSuite {
* @param expectedAnswer the expected result in a [[Seq]] of
[[Product]]s.
*/
protected def checkAnswer[A <: Product : TypeTag](
- input: DataFrame,
- planFunction: SparkPlan => SparkPlan,
+ input: DataFrame,
+ planFunction: SparkPlan => SparkPlan,
+ expectedAnswer: Seq[A]): Unit = {
+ val expectedRows = expectedAnswer.map(Row.fromTuple)
+ checkAnswer(input, planFunction, expectedRows)
+ }
+
+ /**
+ * Runs the plan and makes sure the answer matches the expected result.
+ * @param left the left input data to be used.
+ * @param right the right input data to be used.
+ * @param planFunction a function which accepts the input SparkPlan and
uses it to instantiate
+ * the physical operator that's being tested.
+ * @param expectedAnswer the expected result in a [[Seq]] of
[[Product]]s.
+ */
+ protected def checkAnswer[A <: Product : TypeTag](
+ left: DataFrame,
--- End diff --
Style: these parameters need to be indented more.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]