Skip to content

[SPARK-52587][SHELL] spark-shell 2.13 support -i -I parameter #51294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion repl/src/main/scala/org/apache/spark/repl/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ object Main extends Logging {

def main(args: Array[String]): Unit = {
isShellSession = true
doMain(args, new SparkILoop)
val settings = new GenericRunnerSettings(scalaOptionError)
settings.processArguments(args.toList, true)
doMain(args, new SparkILoop(settings))
}

// Visible for testing
Expand Down
12 changes: 9 additions & 3 deletions repl/src/main/scala/org/apache/spark/repl/SparkILoop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ import scala.util.Properties.{javaVersion, javaVmName, versionString}
/**
* A Spark-specific interactive shell.
*/
class SparkILoop(in0: BufferedReader, out: PrintWriter)
extends ILoop(ShellConfig(new GenericRunnerSettings(_ => ())), in0, out) {
def this() = this(null, new PrintWriter(Console.out, true))
class SparkILoop(config: ShellConfig, in0: BufferedReader, out: PrintWriter)
extends ILoop(config, in0, out) {
def this(in0: BufferedReader, out: PrintWriter) = this(
ShellConfig(new GenericRunnerSettings(_ => ())), in0, out)

def this(settings: Settings) = this(ShellConfig(settings), null,
new PrintWriter(Console.out, true))

def this() = this(new GenericRunnerSettings(_ => ()))

val initializationCommands: Seq[String] = Seq(
"""
Expand Down