diff options
author | Yin Huai <yhuai@databricks.com> | 2016-05-31 12:30:34 -0700 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2016-05-31 12:30:34 -0700 |
commit | c6de5832bfad423e7d6f7e0a92a48170265f25cd (patch) | |
tree | 34160fcacac315147a95435c356442a1ac81dd89 /repl/src | |
parent | 2bfed1a0c5be7d0718fd574a4dad90f4f6b44be7 (diff) | |
download | spark-c6de5832bfad423e7d6f7e0a92a48170265f25cd.tar.gz spark-c6de5832bfad423e7d6f7e0a92a48170265f25cd.tar.bz2 spark-c6de5832bfad423e7d6f7e0a92a48170265f25cd.zip |
[SPARK-15622][SQL] Wrap the parent classloader of Janino's classloader in the ParentClassLoader.
## What changes were proposed in this pull request?
At https://github.com/aunkrig/janino/blob/janino_2.7.8/janino/src/org/codehaus/janino/ClassLoaderIClassLoader.java#L80-L85, Janino's classloader throws the exception when its parent throws a ClassNotFoundException with a cause set. However, it does not throw the exception when there is no cause set. Seems we need to use a special ClassLoader to wrap the actual parent classloader set to Janino handle this behavior.
## How was this patch tested?
I have reverted the workaround made by https://issues.apache.org/jira/browse/SPARK-11636 ( https://github.com/apache/spark/compare/master...yhuai:SPARK-15622?expand=1#diff-bb538fda94224dd0af01d0fd7e1b4ea0R81) and `test-only *ReplSuite -- -z "SPARK-2576 importing implicits"` still passes the test (without the change in `CodeGenerator`, this test does not pass with the change in `ExecutorClassLoader `).
Author: Yin Huai <yhuai@databricks.com>
Closes #13366 from yhuai/SPARK-15622.
Diffstat (limited to 'repl/src')
-rw-r--r-- | repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala b/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala index 4a15d52b57..2f07395edf 100644 --- a/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala +++ b/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala @@ -79,13 +79,7 @@ class ExecutorClassLoader( case e: ClassNotFoundException => val classOption = findClassLocally(name) classOption match { - case None => - // If this class has a cause, it will break the internal assumption of Janino - // (the compiler used for Spark SQL code-gen). - // See org.codehaus.janino.ClassLoaderIClassLoader's findIClass, you will see - // its behavior will be changed if there is a cause and the compilation - // of generated class will fail. - throw new ClassNotFoundException(name) + case None => throw new ClassNotFoundException(name, e) case Some(a) => a } } |