Repository: spark
Updated Branches:
  refs/heads/master a29ee55aa -> 9abd05b6b


[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.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9abd05b6
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9abd05b6
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9abd05b6

Branch: refs/heads/master
Commit: 9abd05b6b94eda31c47bce1f913af988c35f1cb1
Parents: a29ee55
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:46 2016 +0000

----------------------------------------------------------------------
 .../expressions/CodeGenerationSuite.scala        | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/9abd05b6/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]

Reply via email to