Skip to content

Commit

Permalink
Fix some IntelliJ inspections and delete some dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Jun 18, 2015
1 parent 84214be commit f8ce275
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import org.apache.spark.sql.catalyst.dsl.expressions._

class SortSuite extends SparkPlanTest {

// This test was originally added as an example of how to use [[SparkPlanTest]];
// it's not designed to be a comprehensive test of ExternalSort.
test("basic sorting using ExternalSort") {

val input = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,6 @@ class SparkPlanTest extends SparkFunSuite {
case None =>
}
}

/**
* Runs the plan and makes sure the answer matches the expected result.
* @param input the 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](
input: Seq[A],
planFunction: SparkPlan => SparkPlan,
expectedAnswer: Seq[A]): Unit = {
val inputDf = TestSQLContext.createDataFrame(input)
val expectedRows = expectedAnswer.map(Row.fromTuple)
SparkPlanTest.checkAnswer(inputDf, planFunction, expectedRows) match {
case Some(errorMessage) => fail(errorMessage)
case None =>
}
}
}

/**
Expand Down Expand Up @@ -128,9 +109,8 @@ object SparkPlanTest {

plan.transformExpressions {
case UnresolvedAttribute(Seq(u)) =>
inputMap.get(u).getOrElse {
sys.error(s"Invalid Test: Cannot resolve $u given input ${inputMap}")
}
inputMap.getOrElse(u,
sys.error(s"Invalid Test: Cannot resolve $u given input $inputMap"))
}
}

Expand Down

0 comments on commit f8ce275

Please sign in to comment.