File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
main/scala/org/apache/spark/sql/execution
test/scala/org/apache/spark/sql/execution Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments