@@ -19,6 +19,8 @@ package org.apache.spark.repl
1919
2020import java .io .BufferedReader
2121
22+ import scala .concurrent .Await
23+
2224// scalastyle:off println
2325import scala .Predef .{println => _ , _ }
2426// scalastyle:on println
@@ -167,6 +169,7 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)
167169 )
168170 // power mode setup
169171 if (isReplPower) enablePowerMode(true )
172+ initializeSpark()
170173 loadInitFiles()
171174 // SI-7418 Now, and only now, can we enable TAB completion.
172175 in.postInit()
@@ -203,26 +206,28 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)
203206 }
204207 }
205208 def startup (): String = withSuppressedSettings {
206- // while we go fire up the REPL
209+ // let them start typing
207210 val splash = preLoop
208211
212+ // while we go fire up the REPL
209213 try {
210214 // don't allow ancient sbt to hijack the reader
211215 savingReader {
212216 createInterpreter()
213217 }
214218 intp.initializeSynchronous()
215- initializeSpark()
216219
217- // globalFuture = Future successful true
220+ val field = classOf [ILoop ].getDeclaredFields.filter(_.getName.contains(" globalFuture" )).head
221+ field.setAccessible(true )
222+ field.set(this , Future successful true )
223+
224+ // val globalFuture: Future[Boolean] =
218225 if (intp.reporter.hasErrors) {
219226 echo(" Interpreter encountered errors during initialization!" )
220227 null
221228 } else {
222229 loopPostInit()
223-
224230 printWelcome()
225- // let them start typing
226231 splash.start()
227232
228233 val line = splash.line // what they typed in while they were waiting
0 commit comments