Skip to content

Commit 9abd05b

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 <wenchen@databricks.com> Closes #16244 from cloud-fan/minor.
1 parent a29ee55 commit 9abd05b

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
@@ -98,20 +98,15 @@ class CodeGenerationSuite extends SparkFunSuite with ExpressionEvalHelper {
9898
}
9999

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

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

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

0 commit comments

Comments
 (0)