You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by kiszk <gi...@git.apache.org> on 2017/05/19 13:27:09 UTC

[GitHub] spark pull request #15591: [SPARK-17922] [SQL] ClassCastException ..Generate...

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

    https://github.com/apache/spark/pull/15591#discussion_r117479774
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DelegateClassLoader.scala ---
    @@ -0,0 +1,37 @@
    +package org.apache.spark.sql.catalyst.util
    +/*
    + * See : https://issues.apache.org/jira/browse/SPARK-17922. 
    + * Janino compiler internally creates a byteclassloader (http://grepcode.com/file/repo1.maven.org/maven2/org.codehaus.janino/janino/2.5.15/org/codehaus/janino/ByteArrayClassLoader.java#ByteArrayClassLoader)
    + * to load the compiled generated class. But this class loader doesnot override load class to load the class from byte array for the generated class.
    + * Instead the call first goes to parent class loader and if somehow the classloader finds the old generatedClass( all the generated class names are same)
    + * it will incorrectly load the old generated class. This class loader will be used to intercept delegation to parent if the class has to be loaded by the current byte class loader.
    + * This will be set as the parent class loader for janino compiler in CodeGenerator.doCompile
    + * Special classloader to skip delegating to parent class loader when the class name is same as the generated class name.
    + * Because that class should be loaded by the current class loader 
    --- End diff --
    
    What do you mean "the current class loader"? Application class loader? System class loader? Other class loaders?


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

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