Skip to content

Commit

Permalink
[SPARK-8443][SQL] Execute and verify split projections in test
Browse files Browse the repository at this point in the history
  • Loading branch information
saurfang committed Jul 19, 2015
1 parent adef95a commit b7a7635
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.apache.spark.sql.catalyst.expressions.codegen._
/**
* Additional tests for code generation.
*/
class CodeGenerationSuite extends SparkFunSuite {
class CodeGenerationSuite extends SparkFunSuite with ExpressionEvalHelper {

test("multithreaded eval") {
import scala.concurrent._
Expand All @@ -43,7 +43,15 @@ class CodeGenerationSuite extends SparkFunSuite {
futures.foreach(Await.result(_, 10.seconds))
}

test("SPARK-8443: code size limit") {
GenerateMutableProjection.generate(List.fill(5000)(EqualTo(Literal(1), Literal(1))))
test("SPARK-8443: split wide projections into blocks due to JVM code size limit") {
val length = 5000
val expressions = List.fill(length)(EqualTo(Literal(1), Literal(1)))
val plan = GenerateMutableProjection.generate(expressions)()
val actual = plan(new GenericMutableRow(length)).toSeq
val expected = Seq.fill(length)(true)

if (!checkResult(actual, expected)) {
fail(s"Incorrect Evaluation: expressions: $expressions, actual: $actual, expected: $expected")
}
}
}

0 comments on commit b7a7635

Please sign in to comment.