Skip to content

Commit 06f592c

Browse files
cloud-fansrowen
authored andcommitted
[SQL][MINOR] simplify a test to fix the maven tests
## What changes were proposed in this pull request? After #15620 , all of the Maven-based 2.0 Jenkins jobs time out consistently. As I pointed out in #15620 (comment) , 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 9abd05b) Signed-off-by: Sean Owen <[email protected]>
1 parent 2c342e5 commit 06f592c

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CodeGenerationSuite.scala

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,15 @@ class CodeGenerationSuite extends SparkFunSuite with ExpressionEvalHelper {
9696
}
9797

9898
test("SPARK-18091: split large if expressions into blocks due to JVM code size limit") {
99-
val inStr = "StringForTesting"
100-
val row = create_row(inStr)
101-
val inputStrAttr = 'a.string.at(0)
102-
103-
var strExpr: Expression = inputStrAttr
104-
for (_ <- 1 to 13) {
105-
strExpr = If(EqualTo(Decode(Encode(strExpr, "utf-8"), "utf-8"), inputStrAttr),
106-
strExpr, strExpr)
99+
var strExpr: Expression = Literal("abc")
100+
for (_ <- 1 to 150) {
101+
strExpr = Decode(Encode(strExpr, "utf-8"), "utf-8")
107102
}
108103

109-
val expressions = Seq(strExpr)
110-
val plan = GenerateUnsafeProjection.generate(expressions, true)
111-
val actual = plan(row).toSeq(expressions.map(_.dataType))
112-
val expected = Seq(UTF8String.fromString(inStr))
104+
val expressions = Seq(If(EqualTo(strExpr, strExpr), strExpr, strExpr))
105+
val plan = GenerateMutableProjection.generate(expressions)
106+
val actual = plan(null).toSeq(expressions.map(_.dataType))
107+
val expected = Seq(UTF8String.fromString("abc"))
113108

114109
if (!checkResult(actual, expected)) {
115110
fail(s"Incorrect Evaluation: expressions: $expressions, actual: $actual, expected: $expected")

0 commit comments

Comments
 (0)