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

    https://github.com/apache/spark/pull/15112#discussion_r79210556
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
 ---
    @@ -910,14 +910,19 @@ object CodeGenerator extends Logging {
         codeAttrField.setAccessible(true)
         classes.foreach { case (_, classBytes) =>
           
CodegenMetrics.METRIC_GENERATED_CLASS_BYTECODE_SIZE.update(classBytes.length)
    -      val cf = new ClassFile(new ByteArrayInputStream(classBytes))
    -      cf.methodInfos.asScala.foreach { method =>
    -        method.getAttributes().foreach { a =>
    -          if (a.getClass.getName == codeAttr.getName) {
    -            CodegenMetrics.METRIC_GENERATED_METHOD_BYTECODE_SIZE.update(
    -              codeAttrField.get(a).asInstanceOf[Array[Byte]].length)
    +      try {
    +        val cf = new ClassFile(new ByteArrayInputStream(classBytes))
    +        cf.methodInfos.asScala.foreach { method =>
    +          method.getAttributes().foreach { a =>
    +            if (a.getClass.getName == codeAttr.getName) {
    +              CodegenMetrics.METRIC_GENERATED_METHOD_BYTECODE_SIZE.update(
    +                codeAttrField.get(a).asInstanceOf[Array[Byte]].length)
    +            }
               }
             }
    --- End diff --
    
    How about my suggestion of adding the workaround and filing a bug? Then 
there's no worry about forgetting anything.
    
    Because it's most probably a Janino bug, fixing it might not be as simple 
as just making some change in Spark.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to