Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11301#discussion_r54783735
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegen.scala 
---
    @@ -284,7 +284,14 @@ case class WholeStageCodegen(plan: CodegenSupport, 
children: Seq[SparkPlan])
             ${ctx.declareAddedFunctions()}
     
             protected void processNext() throws java.io.IOException {
    -          ${code.trim}
    +          try {
    +            ${code.trim}
    +          } catch (final Throwable e) {
    +            org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(this.getClass());
    +            logger.error("The method processNext() is generated for " +
    +                         "${plan.origin.callSite.getOrElse("unknown")}");
    +            throw e;
    +          }
    --- End diff --
    
    While I generated ```class GeneratedIterator extends 
org.apache.spark.sql.execution.BufferedRowIterator implements 
org.apache.spark.Logging {```, I got the error 
```org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 
11, Column 6: Non-abstract class 
"org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator" 
must implement method "public abstract org.slf4j.Logger 
org.apache.spark.Logging.org$apache$spark$Logging$$log_()"```.
    
    According to this 
[entry](http://stackoverflow.com/questions/7637752/using-scala-traits-with-implemented-methods-in-java),
 we may support ```Logging``` for now. But, it seems too fragile regarding to 
future changes in ```Logging```. As a result, I would like to use ```Logger```.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to