Skip to content

Commit fca22b7

Browse files
committed
Fix
1 parent dfde49b commit fca22b7

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,11 @@ case class WholeStageCodegenExec(child: SparkPlan) extends UnaryExecNode with Co
392392

393393
// Check if compiled code has a too large function
394394
if (maxCodeSize > sqlContext.conf.hugeMethodLimit) {
395-
logWarning(s"Found too long generated codes: the bytecode size was $maxCodeSize and " +
396-
s"this value went over the limit ${sqlContext.conf.hugeMethodLimit}. To avoid this, " +
397-
s"you can the limit ${SQLConf.WHOLESTAGE_HUGE_METHOD_LIMIT.key} higher:\n$treeString")
395+
logWarning(s"Found too long generated codes and JIT optimization might not work: " +
396+
s"the bytecode size was $maxCodeSize, this value went over the limit " +
397+
s"${sqlContext.conf.hugeMethodLimit}, and the whole-stage codegen was disable " +
398+
s"for this plan. To avoid this, you can set the limit " +
399+
s"${SQLConf.WHOLESTAGE_HUGE_METHOD_LIMIT.key} higher:\n$treeString")
398400
return child.execute()
399401
}
400402

sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class WholeStageCodegenSuite extends SparkPlanTest with SharedSQLContext {
151151
}
152152
}
153153

154-
def genGroupByCodeGenContext(caseNum: Int): (CodegenContext, CodeAndComment) = {
154+
def genGroupByCodeGenContext(caseNum: Int): CodeAndComment = {
155155
val caseExp = (1 to caseNum).map { i =>
156156
s"case when id > $i and id <= ${i + 1} then 1 else 0 end as v$i"
157157
}.toList
@@ -176,14 +176,14 @@ class WholeStageCodegenSuite extends SparkPlanTest with SharedSQLContext {
176176
})
177177

178178
assert(wholeStageCodeGenExec.isDefined)
179-
wholeStageCodeGenExec.get.asInstanceOf[WholeStageCodegenExec].doCodeGen()
179+
wholeStageCodeGenExec.get.asInstanceOf[WholeStageCodegenExec].doCodeGen()._2
180180
}
181181

182182
test("SPARK-21871 check if we can get large code size when compiling too long functions") {
183-
val (_, codeWithShortFunctions) = genGroupByCodeGenContext(3)
183+
val codeWithShortFunctions = genGroupByCodeGenContext(3)
184184
val (_, maxCodeSize1) = CodeGenerator.compile(codeWithShortFunctions)
185185
assert(maxCodeSize1 < SQLConf.WHOLESTAGE_HUGE_METHOD_LIMIT.defaultValue.get)
186-
val (_, codeWithLongFunctions) = genGroupByCodeGenContext(20)
186+
val codeWithLongFunctions = genGroupByCodeGenContext(20)
187187
val (_, maxCodeSize2) = CodeGenerator.compile(codeWithLongFunctions)
188188
assert(maxCodeSize2 > SQLConf.WHOLESTAGE_HUGE_METHOD_LIMIT.defaultValue.get)
189189
}

0 commit comments

Comments
 (0)