You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2017/11/02 09:45:37 UTC
spark git commit: [SPARK-14650][REPL][BUILD] Compile Spark REPL for
Scala 2.12
Repository: spark
Updated Branches:
refs/heads/master b04eefae4 -> 849b465bb
[SPARK-14650][REPL][BUILD] Compile Spark REPL for Scala 2.12
## What changes were proposed in this pull request?
Spark REPL changes for Scala 2.12.4: use command(), not processLine() in ILoop; remove direct dependence on older jline. Not sure whether this became needed in 2.12.4 or just missed this before. This makes spark-shell work in 2.12.
## How was this patch tested?
Existing tests; manual run of spark-shell in 2.11, 2.12 builds
Author: Sean Owen <so...@cloudera.com>
Closes #19612 from srowen/SPARK-14650.2.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/849b465b
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/849b465b
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/849b465b
Branch: refs/heads/master
Commit: 849b465bbf472d6ca56308fb3ccade86e2244e01
Parents: b04eefa
Author: Sean Owen <so...@cloudera.com>
Authored: Thu Nov 2 09:45:34 2017 +0000
Committer: Sean Owen <so...@cloudera.com>
Committed: Thu Nov 2 09:45:34 2017 +0000
----------------------------------------------------------------------
pom.xml | 15 ++++++++++-----
repl/pom.xml | 4 ----
.../scala/org/apache/spark/repl/SparkILoop.scala | 13 +++++--------
3 files changed, 15 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/849b465b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 652aed4..8570338 100644
--- a/pom.xml
+++ b/pom.xml
@@ -735,6 +735,12 @@
<artifactId>scalap</artifactId>
<version>${scala.version}</version>
</dependency>
+ <!-- SPARK-16770 affecting Scala 2.11.x -->
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>2.12.1</version>
+ </dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.binary.version}</artifactId>
@@ -1188,6 +1194,10 @@
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -1926,11 +1936,6 @@
<version>${antlr4.version}</version>
</dependency>
<dependency>
- <groupId>jline</groupId>
- <artifactId>jline</artifactId>
- <version>2.12.1</version>
- </dependency>
- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-crypto</artifactId>
<version>${commons-crypto.version}</version>
http://git-wip-us.apache.org/repos/asf/spark/blob/849b465b/repl/pom.xml
----------------------------------------------------------------------
diff --git a/repl/pom.xml b/repl/pom.xml
index bd2cfc4..1cb0098 100644
--- a/repl/pom.xml
+++ b/repl/pom.xml
@@ -70,10 +70,6 @@
<artifactId>scala-reflect</artifactId>
<version>${scala.version}</version>
</dependency>
- <dependency>
- <groupId>jline</groupId>
- <artifactId>jline</artifactId>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
http://git-wip-us.apache.org/repos/asf/spark/blob/849b465b/repl/scala-2.12/src/main/scala/org/apache/spark/repl/SparkILoop.scala
----------------------------------------------------------------------
diff --git a/repl/scala-2.12/src/main/scala/org/apache/spark/repl/SparkILoop.scala b/repl/scala-2.12/src/main/scala/org/apache/spark/repl/SparkILoop.scala
index 4135940..900edd6 100644
--- a/repl/scala-2.12/src/main/scala/org/apache/spark/repl/SparkILoop.scala
+++ b/repl/scala-2.12/src/main/scala/org/apache/spark/repl/SparkILoop.scala
@@ -19,9 +19,6 @@ package org.apache.spark.repl
import java.io.BufferedReader
-// scalastyle:off println
-import scala.Predef.{println => _, _}
-// scalastyle:on println
import scala.tools.nsc.Settings
import scala.tools.nsc.interpreter.{ILoop, JPrintWriter}
import scala.tools.nsc.util.stringFromStream
@@ -37,7 +34,7 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)
def initializeSpark() {
intp.beQuietDuring {
- processLine("""
+ command("""
@transient val spark = if (org.apache.spark.repl.Main.sparkSession != null) {
org.apache.spark.repl.Main.sparkSession
} else {
@@ -64,10 +61,10 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)
_sc
}
""")
- processLine("import org.apache.spark.SparkContext._")
- processLine("import spark.implicits._")
- processLine("import spark.sql")
- processLine("import org.apache.spark.sql.functions._")
+ command("import org.apache.spark.SparkContext._")
+ command("import spark.implicits._")
+ command("import spark.sql")
+ command("import org.apache.spark.sql.functions._")
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org