aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorWenchen Fan <wenchen@databricks.com>2016-12-11 09:12:46 +0000
committerSean Owen <sowen@cloudera.com>2016-12-11 09:12:46 +0000
commit9abd05b6b94eda31c47bce1f913af988c35f1cb1 (patch)
tree96df4488a8c86c413495f97e55d13ca07fd16aec /sql
parenta29ee55aaadfe43ac9abb0eaf8b022b1e6d7babb (diff)
downloadspark-9abd05b6b94eda31c47bce1f913af988c35f1cb1.tar.gz
spark-9abd05b6b94eda31c47bce1f913af988c35f1cb1.tar.bz2
spark-9abd05b6b94eda31c47bce1f913af988c35f1cb1.zip
[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 <wenchen@databricks.com> Closes #16244 from cloud-fan/minor.
Diffstat (limited to 'sql')
-rw-r--r--sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CodeGenerationSuite.scala19
1 files changed, 7 insertions, 12 deletions
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 0f4b4b5bc8..ee5d1f6373 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")