Skip to content
Snippets Groups Projects
Unverified Commit 9abd05b6 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.
parent a29ee55a
No related branches found
No related tags found
No related merge requests found
...@@ -98,20 +98,15 @@ class CodeGenerationSuite extends SparkFunSuite with ExpressionEvalHelper { ...@@ -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") { test("SPARK-18091: split large if expressions into blocks due to JVM code size limit") {
val inStr = "StringForTesting" var strExpr: Expression = Literal("abc")
val row = create_row(inStr) for (_ <- 1 to 150) {
val inputStrAttr = 'a.string.at(0) strExpr = Decode(Encode(strExpr, "utf-8"), "utf-8")
var strExpr: Expression = inputStrAttr
for (_ <- 1 to 13) {
strExpr = If(EqualTo(Decode(Encode(strExpr, "utf-8"), "utf-8"), inputStrAttr),
strExpr, strExpr)
} }
val expressions = Seq(strExpr) val expressions = Seq(If(EqualTo(strExpr, strExpr), strExpr, strExpr))
val plan = GenerateUnsafeProjection.generate(expressions, true) val plan = GenerateMutableProjection.generate(expressions)
val actual = plan(row).toSeq(expressions.map(_.dataType)) val actual = plan(null).toSeq(expressions.map(_.dataType))
val expected = Seq(UTF8String.fromString(inStr)) val expected = Seq(UTF8String.fromString("abc"))
if (!checkResult(actual, expected)) { if (!checkResult(actual, expected)) {
fail(s"Incorrect Evaluation: expressions: $expressions, actual: $actual, expected: $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