You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/03/11 23:51:51 UTC

[GitHub] [spark] 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

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_r391333502
 
 

 ##########
 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:
   How do we handle the non-whole stage codegen case? e.g., `GenerateMutableProjection` via `CodeGeneratorWithInterpretedFallback`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org