Skip to content
Snippets Groups Projects
Unverified Commit d4c03f87 authored by Wenchen Fan's avatar Wenchen Fan Committed by Sean Owen
Browse files

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

(cherry picked from commit 9abd05b6)
Signed-off-by: default avatarSean Owen <sowen@cloudera.com>
parent de21ca46
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment