diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2016-02-09 09:05:22 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-02-09 09:05:22 +0000 |
commit | e30121afac35439be5d42c04da6f047f7d973dd6 (patch) | |
tree | 83cff29a3c502222ad136124a965eade3ebedd56 /repl/scala-2.11/src/main/scala | |
parent | d9ba4d27f4d324a7055b9b914c75d176f3e2f71d (diff) | |
download | spark-e30121afac35439be5d42c04da6f047f7d973dd6.tar.gz spark-e30121afac35439be5d42c04da6f047f7d973dd6.tar.bz2 spark-e30121afac35439be5d42c04da6f047f7d973dd6.zip |
[SPARK-13086][SHELL] Use the Scala REPL settings, to enable things like `-i file`.
Now:
```
$ bin/spark-shell -i test.scala
NOTE: SPARK_PREPEND_CLASSES is set, placing locally compiled Spark classes ahead of assembly.
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel).
16/01/29 17:37:38 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/01/29 17:37:39 INFO Main: Created spark context..
Spark context available as sc (master = local[*], app id = local-1454085459000).
16/01/29 17:37:39 INFO Main: Created sql context..
SQL context available as sqlContext.
Loading test.scala...
hello
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 2.0.0-SNAPSHOT
/_/
Using Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45)
Type in expressions to have them evaluated.
Type :help for more information.
```
Author: Iulian Dragos <jaguarul@gmail.com>
Closes #10984 from dragos/issue/repl-eval-file.
Diffstat (limited to 'repl/scala-2.11/src/main/scala')
-rw-r--r-- | repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala b/repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala index 07ba28bb07..1ae4182947 100644 --- a/repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala +++ b/repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala @@ -19,7 +19,7 @@ package org.apache.spark.repl import java.io.File -import scala.tools.nsc.Settings +import scala.tools.nsc.GenericRunnerSettings import org.apache.spark.util.Utils import org.apache.spark._ @@ -56,7 +56,7 @@ object Main extends Logging { "-classpath", getAddedJars.mkString(File.pathSeparator) ) ++ args.toList - val settings = new Settings(scalaOptionError) + val settings = new GenericRunnerSettings(scalaOptionError) settings.processArguments(interpArguments, true) if (!hasErrors) { |