Skip to content

Commit

Permalink
LIVY-323. Fixed livy-repl doesn't start with a lot of spark packages. (
Browse files Browse the repository at this point in the history
…apache#312)

Some Spark packages are depending on scala-reflect 2.11.0 and it conflicts with Spark's scala version 2.11.8.
This's not Livy's fault actually but doesn't hurt to make Livy more fault tolerant.
Since the scala-reflect jar with the correct version must already be in CLASSPATH, fixed livy-repl to not load user supplied scala-reflect jars.
  • Loading branch information
alex-the-man authored Apr 9, 2017
1 parent 221aa9c commit 07f6072
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ class SparkInterpreter(conf: SparkConf,
.filter { u => u.getProtocol == "file" && new File(u.getPath).isFile }
// Livy rsc and repl are also in the extra jars list. Filter them out.
.filterNot { u => Paths.get(u.toURI).getFileName.toString.startsWith("livy-") }
// Some bad spark packages depend on the wrong version of scala-reflect. Blacklist it.
.filterNot { u =>
Paths.get(u.toURI).getFileName.toString.contains("org.scala-lang_scala-reflect")
}

extraJarPath.foreach { p => debug(s"Adding $p to Scala interpreter's class path...") }
sparkIMain.addUrlsToClassPath(extraJarPath: _*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class SparkInterpreter(conf: SparkConf,
.filter { u => u.getProtocol == "file" && new File(u.getPath).isFile }
// Livy rsc and repl are also in the extra jars list. Filter them out.
.filterNot { u => Paths.get(u.toURI).getFileName.toString.startsWith("livy-") }
// Some bad spark packages depend on the wrong version of scala-reflect. Blacklist it.
.filterNot { u =>
Paths.get(u.toURI).getFileName.toString.contains("org.scala-lang_scala-reflect")
}

extraJarPath.foreach { p => debug(s"Adding $p to Scala interpreter's class path...") }
sparkILoop.addUrlsToClassPath(extraJarPath: _*)
Expand Down

0 comments on commit 07f6072

Please sign in to comment.