diff options
author | Michael Armbrust <michael@databricks.com> | 2015-11-20 15:17:17 -0800 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2015-11-20 15:17:17 -0800 |
commit | 4b84c72dfbb9ddb415fee35f69305b5d7b280891 (patch) | |
tree | fc539c382da5480312a8be25afe8b9a922811ded /repl/src | |
parent | a6239d587c638691f52eca3eee905c53fbf35a12 (diff) | |
download | spark-4b84c72dfbb9ddb415fee35f69305b5d7b280891.tar.gz spark-4b84c72dfbb9ddb415fee35f69305b5d7b280891.tar.bz2 spark-4b84c72dfbb9ddb415fee35f69305b5d7b280891.zip |
[SPARK-11636][SQL] Support classes defined in the REPL with Encoders
#theScaryParts (i.e. changes to the repl, executor classloaders and codegen)...
Author: Michael Armbrust <michael@databricks.com>
Author: Yin Huai <yhuai@databricks.com>
Closes #9825 from marmbrus/dataset-replClasses2.
Diffstat (limited to 'repl/src')
-rw-r--r-- | repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala | 8 |
1 files changed, 7 insertions, 1 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 3d2d235a00..a976e96809 100644 --- a/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala +++ b/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala @@ -65,7 +65,13 @@ class ExecutorClassLoader(conf: SparkConf, classUri: String, parent: ClassLoader case e: ClassNotFoundException => { val classOption = findClassLocally(name) classOption match { - case None => throw new ClassNotFoundException(name, e) + 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 Some(a) => a } } |