Repository: spark Updated Branches: refs/heads/branch-2.1 de21ca46e -> d4c03f876
[SQL][MINOR] simplify a test to fix the maven tests ## What changes were proposed in this pull request? After https://github.com/apache/spark/pull/15620 , all of the Maven-based 2.0 Jenkins jobs time out consistently. As I pointed out in https://github.com/apache/spark/pull/15620#discussion_r91829129 , it seems that the regression test is an overkill and may hit constants pool size limitation, which is a known issue and hasn't been fixed yet. Since #15620 only fix the code size limitation problem, we can simplify the test to avoid hitting constants pool size limitation. ## How was this patch tested? test only change Author: Wenchen Fan <[email protected]> Closes #16244 from cloud-fan/minor. (cherry picked from commit 9abd05b6b94eda31c47bce1f913af988c35f1cb1) Signed-off-by: Sean Owen <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d4c03f87 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d4c03f87 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d4c03f87 Branch: refs/heads/branch-2.1 Commit: d4c03f8769f063b0dfac7d000513a2bc20989549 Parents: de21ca4 Author: Wenchen Fan <[email protected]> Authored: Sun Dec 11 09:12:46 2016 +0000 Committer: Sean Owen <[email protected]> Committed: Sun Dec 11 09:12:55 2016 +0000 ---------------------------------------------------------------------- .../expressions/CodeGenerationSuite.scala | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/d4c03f87/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CodeGenerationSuite.scala ---------------------------------------------------------------------- diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CodeGenerationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CodeGenerationSuite.scala index 0f4b4b5..ee5d1f6 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CodeGenerationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CodeGenerationSuite.scala @@ -98,20 +98,15 @@ class CodeGenerationSuite extends SparkFunSuite with ExpressionEvalHelper { } test("SPARK-18091: split large if expressions into blocks due to JVM code size limit") { - val inStr = "StringForTesting" - val row = create_row(inStr) - val inputStrAttr = 'a.string.at(0) - - var strExpr: Expression = inputStrAttr - for (_ <- 1 to 13) { - strExpr = If(EqualTo(Decode(Encode(strExpr, "utf-8"), "utf-8"), inputStrAttr), - strExpr, strExpr) + var strExpr: Expression = Literal("abc") + for (_ <- 1 to 150) { + strExpr = Decode(Encode(strExpr, "utf-8"), "utf-8") } - val expressions = Seq(strExpr) - val plan = GenerateUnsafeProjection.generate(expressions, true) - val actual = plan(row).toSeq(expressions.map(_.dataType)) - val expected = Seq(UTF8String.fromString(inStr)) + val expressions = Seq(If(EqualTo(strExpr, strExpr), strExpr, strExpr)) + val plan = GenerateMutableProjection.generate(expressions) + val actual = plan(null).toSeq(expressions.map(_.dataType)) + val expected = Seq(UTF8String.fromString("abc")) if (!checkResult(actual, expected)) { fail(s"Incorrect Evaluation: expressions: $expressions, actual: $actual, expected: $expected") --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
