Skip to content

Commit 02bf095

Browse files
committed
spark-submit updates
1 parent 9e9a759 commit 02bf095

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

project-templates/java/src/main/java/com/databricks/example/SimpleExample.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main.example;
1+
package com.databricks.example;
22

33
import org.apache.spark.sql.SparkSession;
44

@@ -12,7 +12,7 @@ public static void main(String[] args) {
1212
.builder()
1313
.getOrCreate();
1414

15-
spark.range(1, 2000).count();
15+
System.out.println(spark.range(1, 2000).count());
1616

1717
}
1818
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
2-
3-
1+
from __future__ import print_function
42

53
if __name__ == '__main__':
64

@@ -11,3 +9,5 @@
119
.appName("Word Count") \
1210
.config("spark.some.config.option", "some-value") \
1311
.getOrCreate()
12+
13+
print(spark.range(5000).where("id > 500").selectExpr("sum(id)").collect())

project-templates/scala/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
project/target/*
1+
project/*
22
target/*

project-templates/scala/build.sbt

+7-6
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,30 @@ libraryDependencies ++= Seq(
4545
//////////
4646

4747
// Your username to login to Databricks
48-
dbcUsername := sys.env("DATABRICKSUSERNAME")
48+
val dbcUsername = sys.env("DATABRICKSUSERNAME")
4949

5050
// Your password (Can be set as an environment variable)
51-
dbcPassword := sys.env("DATABRICKSPASSWORD")
51+
val dbcPassword = sys.env("DATABRICKSPASSWORD")
5252
// Gotcha: Setting environment variables in IDE's may differ.
5353
// IDE's usually don't pick up environment variables from .bash_profile or .bashrc
5454

5555
// The URL to the Databricks REST API
56-
dbcApiUrl := "https://your-sub-domain.cloud.databricks.com/api/1.2"
56+
val dbcApiUrl = "https://your-sub-domain.cloud.databricks.com/api/1.2"
5757

5858
// Add any clusters that you would like to deploy your work to. e.g. "My Cluster"
59-
dbcClusters += "my-cluster" // Add "ALL_CLUSTERS" if you want to attach your work to all clusters
59+
val dbcClusters = Seq("my-cluster")
60+
// Add "ALL_CLUSTERS" if you want to attach your work to all clusters
6061

6162
// An optional parameter to set the location to upload your libraries to in the workspace
6263
// e.g. "/Shared/libraries"
6364
// This location must be an existing path and all folders must exist.
6465
// NOTE: Specifying this parameter is *strongly* recommended as many jars will be uploaded to your cluster.
6566
// Putting them in one folder will make it easy for your to delete all the libraries at once.
6667
// Default is "/"
67-
dbcLibraryPath := "/Shared/Libraries"
68+
val dbcLibraryPath = "/Shared/Libraries"
6869

6970
// Whether to restart the clusters everytime a new version is uploaded to Databricks.
70-
dbcRestartOnAttach := false // Default true
71+
val dbcRestartOnAttach = false // Default true
7172

7273
//////////
7374
///// END Databricks Settings

0 commit comments

Comments
 (0)