spylon-kernel icon indicating copy to clipboard operation
spylon-kernel copied to clipboard

ExecutorClassLoader error in Spylon notebook

Open parente opened this issue 7 years ago • 0 comments

Transfer from https://github.com/jupyter/docker-stacks/issues/690

What docker image you are using?

jupyter/all-spark-notebook

What complete docker command do you run to launch the container (omitting sensitive values)?

docker run -it --rm -p 8888:8888 -v "$PWD":/home/jovyan/work jupyter/all-spark-notebook

What steps do you take once the container is running to reproduce the issue?

  1. Visit http://localhost:8888
  2. Start a Spylon noteobok
  3. Execute the following code:
import spark.implicits._

case class A (a1: String, a2: String)
case class B (b1: String, b2: String)

val as = Seq(A("1", "2"), A("2", "2"), A("1", "3"))
val df = spark.createDataFrame(as)
df.as[A].repartition(2, df.col("a1")).mapPartitions(seq => {
    seq.toSeq.groupBy(_.a1).map{
        case (key, group) => {
            val last = group.maxBy(_.a2)
            B(last.a1, last.a2)
        }
    }.iterator
}).collect()

What do you expect to happen?

We should have the following result:

res0: Array[B] = Array(B(1,3), B(2,2))

What actually happens?

It fails with the following exception:

2018-08-03 12:49:01 ERROR ExecutorClassLoader:91 - Failed to check existence of class <root>.package on REPL class server at spark://dc5457f81c19:39449/classes
java.net.URISyntaxException: Illegal character in path at index 35: spark://dc5457f81c19:39449/classes/<root>/package.class

Note that the same code, typed directly in a spark-shell session (launched using a terminal from Jupyter) gives the correct result.

parente avatar Aug 03 '18 13:08 parente