Skip to content

Commit f8ce275

Browse files
committed
Fix some IntelliJ inspections and delete some dead code
1 parent 84214be commit f8ce275

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import org.apache.spark.sql.catalyst.dsl.expressions._
2121

2222
class SortSuite extends SparkPlanTest {
2323

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.
2426
test("basic sorting using ExternalSort") {
2527

2628
val input = Seq(

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

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -77,25 +77,6 @@ class SparkPlanTest extends SparkFunSuite {
7777
case None =>
7878
}
7979
}
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-
}
9980
}
10081

10182
/**
@@ -128,9 +109,8 @@ object SparkPlanTest {
128109

129110
plan.transformExpressions {
130111
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"))
134114
}
135115
}
136116

0 commit comments

Comments
 (0)