Skip to content

Commit 2cc1605

Browse files
committed
HOTFIX: Add no-arg SparkContext constructor in Java
1 parent 55fddf9 commit 2cc1605

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ import org.apache.spark.rdd.RDD
4141
* [[org.apache.spark.api.java.JavaRDD]]s and works with Java collections instead of Scala ones.
4242
*/
4343
class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWorkaround {
44+
/**
45+
* Create a JavaSparkContext that loads settings from system properties (for instance, when
46+
* launching with ./bin/spark-submit).
47+
*/
48+
def this() = this(new SparkContext())
49+
4450
/**
4551
* @param conf a [[org.apache.spark.SparkConf]] object specifying Spark parameters
4652
*/

0 commit comments

Comments
 (0)