From bce901a2e78f742dc62bdcce0ef4fd71123969d9 Mon Sep 17 00:00:00 2001 From: Garland Zhang Date: Thu, 5 Jun 2025 08:30:48 +0000 Subject: [PATCH] Fix bug where default session is not properly being set + small fixes --- contrib/templates/scala-job/databricks_template_schema.json | 2 +- .../{{.project_name}}/src/main/scala/com/examples/Main.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/templates/scala-job/databricks_template_schema.json b/contrib/templates/scala-job/databricks_template_schema.json index 3bfe1bce..2723d1d7 100644 --- a/contrib/templates/scala-job/databricks_template_schema.json +++ b/contrib/templates/scala-job/databricks_template_schema.json @@ -10,7 +10,7 @@ }, "artifacts_dest_path": { "type": "string", - "description": "\nPlease provide the Volumes destination path in Databricks where the directory will be created containing the JAR and other artifacts to store. [example: /Volumes/abcdef1234567890].\nNote: Your admin must allowlist the Volumes JAR path you specify for your workspace (see https://docs.databricks.com/en/data-governance/unity-catalog/manage-privileges/allowlist.html)", + "description": "\nPlease provide the Volumes destination path in Databricks where the directory will be created containing the JAR and other artifacts to store. [example: /Volumes/abcdef1234567890].\nNote: Only when using Standard clusters, your admin must allowlist the Volumes JAR path you specify for your workspace (see https://docs.databricks.com/en/data-governance/unity-catalog/manage-privileges/allowlist.html)", "order": 2, "pattern": "^/Volumes(?:/[a-z0-9_-]+)+$", "pattern_match_failure_message": "Path must be of the form ^/Volumes(?:/[a-z0-9_-]+)+$" diff --git a/contrib/templates/scala-job/template/{{.project_name}}/src/main/scala/com/examples/Main.scala b/contrib/templates/scala-job/template/{{.project_name}}/src/main/scala/com/examples/Main.scala index 0b81582d..177bcd00 100644 --- a/contrib/templates/scala-job/template/{{.project_name}}/src/main/scala/com/examples/Main.scala +++ b/contrib/templates/scala-job/template/{{.project_name}}/src/main/scala/com/examples/Main.scala @@ -26,7 +26,7 @@ object Main { // Get DATABRICKS_RUNTIME_VERSION environment variable if (sys.env.contains("DATABRICKS_RUNTIME_VERSION")) { println("Running in a Databricks cluster") - SparkSession.builder().getOrCreate() + SparkSession.active } else { println("Running outside Databricks") DatabricksSession.builder()