aboutsummaryrefslogtreecommitdiff
path: root/repl/src
diff options
context:
space:
mode:
authorMichael Armbrust <michael@databricks.com>2015-11-20 15:17:17 -0800
committerMichael Armbrust <michael@databricks.com>2015-11-20 15:17:17 -0800
commit4b84c72dfbb9ddb415fee35f69305b5d7b280891 (patch)
treefc539c382da5480312a8be25afe8b9a922811ded /repl/src
parenta6239d587c638691f52eca3eee905c53fbf35a12 (diff)
downloadspark-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.scala8
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
}
}