Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
dbtsai committed Jun 8, 2018
1 parent 96e87c2 commit 4c852fa
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,15 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)

/** Print a welcome message */
override def printWelcome() {
// Before Scala 2.11.9, `printWelcome()` will be the last thing to be called,
// so Scala REPL and Spark will be initialized before `printWelcome()`.
// After Scala 2.11.9, `printWelcome()` will be the first thing to be called,
// as a result, Scala REPL and Spark will be initialized in `printWelcome()`.
if (!isInitializeComplete) {
// Before Scala 2.11.9, `printWelcome()` will be called after Scala REPL and Spark
// are initialized, so we will not call `initializeSynchronous()` in `printWelcome()`.
//
// However, after Scala 2.11.9, `printWelcome()` will be the first thing to be called,
// so we initialize the Scala REPL and Spark here instead.
if (intp == null) {
createInterpreter()
}
if (!intp.isInitializeComplete) {
intp.initializeSynchronous()
}

Expand Down

0 comments on commit 4c852fa

Please sign in to comment.