maropu commented on a change in pull request #27872: [SPARK-31115][SQL] Detect
known Janino bug janino-compiler/janino#113 and apply workaround automatically
as a fail-back via avoid using switch statement in generated code
URL: https://github.com/apache/spark/pull/27872#discussion_r391402526
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala
##########
@@ -688,11 +692,56 @@ case class WholeStageCodegenExec(child: SparkPlan)(val
codegenStageId: Int)
child.executeColumnar()
}
- override def doExecute(): RDD[InternalRow] = {
+ private type CompileResult = (CodegenContext, CodeAndComment,
GeneratedClass, ByteCodeStats)
+
+ /**
+ * NOTE: This method handles the known Janino bug:
+ * - https://github.com/janino-compiler/janino/issues/113
+ *
+ * It tries to generate code and compile in normal path. If the compilation
fails and the reason
+ * is due to the known bug, it generates workaround code via touching flag
in CodegenContext and
+ * compile again.
+ */
+ private def doGenCodeAndCompile(): CompileResult = {
Review comment:
If so, I personally think we'd better fix the generated code of `ExpandExec`
(I'm not sure now that its worth fixing this issue).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]