-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added documentation for databricks connection "wait for cluster" feature
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Connection Options | ||
|
||
When connecting to a Databricks cluster, it might be that the cluster is in the starting state so I have added some code to sit and poll the spark server until the cluster is available. | ||
|
||
There are two options that help configure this and I added the options to the `SparkSessionBuilder`. | ||
|
||
## DatabricksWaitForClusterMaxTime | ||
|
||
This controls how long we will sit and wait for the cluster to start: | ||
|
||
```csharp | ||
var spark = | ||
SparkSession | ||
.Builder | ||
.DatabricksWaitForClusterMaxTime(5) | ||
.GetOrCreate(); | ||
``` | ||
|
||
## DatabricksWaitForClusterOnSessionCreate | ||
|
||
The second option disables the behaviour completely: | ||
|
||
```csharp | ||
var spark = | ||
SparkSession | ||
.Builder | ||
.DatabricksWaitForClusterOnSessionCreate(false) | ||
.GetOrCreate(); | ||
``` |