Skip to content

Commit f06a2fa

Browse files
committed
Spark 2.0 support
1 parent 483a897 commit f06a2fa

File tree

8 files changed

+267
-57
lines changed

8 files changed

+267
-57
lines changed

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ addons:
3333

3434
matrix:
3535
include:
36+
# Test all modules with spark-2.0.0-preview and scala 2.11
37+
- jdk: "oraclejdk7"
38+
env: SCALA_VER="2.11" SPARK_VER="2.0.0-preview" HADOOP_VER="2.3" PROFILE="-Pspark-2.0 -Dspark.version=2.0.0-preview -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pexamples -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS="-Dpython.test.exclude=''"
39+
3640
# Test all modules with scala 2.10
3741
- jdk: "oraclejdk7"
38-
env: SCALA_VER="2.10" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pexamples" BUILD_FLAG="package -Dscala-2.10 -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
42+
env: SCALA_VER="2.10" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pexamples" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
3943

4044
# Test all modules with scala 2.11
4145
- jdk: "oraclejdk7"
42-
env: SCALA_VER="2.11" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pexamples -Pscala-2.11" BUILD_FLAG="package -Dscala-2.11 -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
46+
env: SCALA_VER="2.11" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pexamples -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
4347

4448
# Test spark module for 1.5.2
4549
- jdk: "oraclejdk7"

spark-dependencies/pom.xml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,6 @@
283283
<version>${spark.version}</version>
284284
</dependency>
285285

286-
<dependency>
287-
<groupId>org.apache.spark</groupId>
288-
<artifactId>spark-streaming-twitter_${scala.binary.version}</artifactId>
289-
<version>${spark.version}</version>
290-
</dependency>
291-
292286
<dependency>
293287
<groupId>org.apache.spark</groupId>
294288
<artifactId>spark-catalyst_${scala.binary.version}</artifactId>
@@ -517,9 +511,6 @@
517511

518512
<profile>
519513
<id>spark-1.6</id>
520-
<activation>
521-
<activeByDefault>true</activeByDefault>
522-
</activation>
523514
<properties>
524515
<spark.version>1.6.1</spark.version>
525516
<py4j.version>0.9</py4j.version>
@@ -529,6 +520,19 @@
529520
</properties>
530521
</profile>
531522

523+
<profile>
524+
<id>spark-2.0</id>
525+
<activation>
526+
<activeByDefault>true</activeByDefault>
527+
</activation>
528+
<properties>
529+
<spark.version>2.0.0</spark.version>
530+
<protobuf.version>2.5.0</protobuf.version>
531+
<py4j.version>0.10.1</py4j.version>
532+
<scala.version>2.11.8</scala.version>
533+
</properties>
534+
</profile>
535+
532536
<profile>
533537
<id>hadoop-0.23</id>
534538
<!-- SPARK-1121: Adds an explicit dependency on Avro to work around a

spark/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,15 @@ public JavaSparkContext getJavaSparkContext() {
528528
}
529529
}
530530

531+
public Object getSparkSession() {
532+
SparkInterpreter intp = getSparkInterpreter();
533+
if (intp == null) {
534+
return null;
535+
} else {
536+
return intp.getSparkSession();
537+
}
538+
}
539+
531540
public SparkConf getSparkConf() {
532541
JavaSparkContext sc = getJavaSparkContext();
533542
if (sc == null) {

0 commit comments

Comments
 (0)