# Defining Databricks connection parameters with Spark Structured Streaming

[Preview](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Introduction/feature-preview-program-overview.htm)

Configure a Databricks connection for a Spark Structured Streaming Job.

## Procedure

1. Click the Run view beneath the design workspace, then click the Structured Streaming configuration view.
2. Select Built-in from the Property type list.
3. Select Universal from the Distribution list, select the Spark version, then select Databricks from the Runtime mode/environment list.
4. Select the Define a streaming timeout (ms) check box and, in the field that is displayed, enter the time frame at the end of which the Spark Structured Streaming Job automatically stops running.
5. Complete the Databricks configuration parameters.
   | Parameter | Usage |
   | --- | --- |
   | Cloud provider | Select the cloud provider to be used between<br>AWS, Azure and<br>GCP. |
   | Run mode | Select the mode you want to use to run your Job on Databricks<br>cluster when you execute your Job in Talend Studio. With Create and run now, a new Job is<br>created and run immediately on Databricks and with Runs<br>submit, a one-time run is submitted without creating a<br>Job on Databricks. |
   | Enable Unity Catalog | Select this check box to leverage Unity Catalog. Then, you need to<br>specify the Unity Catalog related information in the<br>Catalog, Schema, and<br>Volume parameters.<br><br>Information noteImportant: All<br>the parameters have to be created on Databricks with granted<br>permissions for all authorized users before using them in Talend Studio. |
   | Use pool | You can select this check box to leverage a Databricks pool. If<br>you do, you must indicate the Pool ID instead<br>of the Cluster ID. You must also select<br>Job clusters from the Cluster<br>type drop-down list. |
   | Endpoint | Enter the URL address of your workspace. |
   | Cluster ID | Enter the ID of the Databricks cluster to be used. This ID is the<br>value of the<br>spark.databricks.clusterUsageTags.clusterId<br>property of your Spark cluster. You can find this property on the<br>properties list in the Environment tab in the<br>Spark UI view of your cluster. |
   | Authentication mode | Select the method to authenticate to Databricks in the drop-down list:<br><br><ul> <li><span>Personal access token</span>: authenticate with                                    a personal access token (PAT). For more information, see <a href="https://docs.databricks.com/aws/en/dev-tools/auth/unified-auth" target="_blank">Databricks personal access                                       token authentication</a> from the Databricks                                    documentation. <p>In <span>Authentication                                       token</span>, enter the authentication token generated                                       for your Databricks user account.</p></li> <li><span>OAuth2</span>: authenticate with OAuth2. For                                    more information, see <a href="https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m" target="_blank">Authenticate access to                                       Databricks using OAuth token federation</a> from the                                    Databricks documentation.<p>In <span>Client ID</span>                                       and <span>Secret ID</span>, enter the OAuth client                                       credentials generated for your Databricks service                                       principal.</p></li> </ul> |
   | Dependencies folder | Enter the directory that is used to store your Job related<br>dependencies on Databricks Filesystem at runtime, putting a slash (/)<br>at the end of this directory. For example, enter<br>/jars/ to store the dependencies in a folder<br>named jars. This folder is created on the fly if<br>it does not exist then.<br><br>From Databricks 15.4 LTS, the default<br>library location is moved to WORKSPACE, instead of<br>DBFS. |
   | Project ID | Enter the ID of your Google Platform project where the Databricks<br>project is located.<br><br>This field is only available when you select<br>GCP from the Cloud<br>provider drop-down list. |
   | Bucket | Enter the name of the bucket you use for Databricks from Google<br>Platform.<br><br>This field is only available when you select<br>GCP from the Cloud<br>provider drop-down list. |
   | Workspace ID | Enter the ID of your Google Platform workspace respecting the<br>following format:<br>databricks-workspaceid.<br><br>This field is only<br>available when you select GCP from the<br>Cloud provider drop-down list. |
   | Google credentials | Enter the directory in which the JSON file containing your service<br>account key is stored in the Talend JobServer machine.<br><br>This field is only available when you select<br>GCP from the Cloud<br>provider drop-down list. |
   | Poll interval when retrieving Job status (in<br>ms) | Enter the time interval (in milliseconds) at the end of which you<br>want Talend Studio to ask Spark for the status of your Job. |
   | Cluster type | From the drop-down list, select the type of cluster you want to<br>use. For more information, see [About Databricks clusters](https://help.qlik.com/talend/en-US/components/8.0/databricks/about-databricks-clusters).<br><br>Information noteNote: When you run the Job using Talend Studio with Java 17, you need to set the<br>JNAME=zulu17-ca-amd64 environment<br>variable:<br><br><ul> <li>on Databricks side for job clusters</li> <li>in <span>Init scripts</span> using the                                             <span>set_java17_dbr.sh</span> script on S3 for                                          all-purpose clusters</li> </ul><br><br>DBFS is no longer supported as Init<br>scripts location. For all versions of Databricks, it<br>is replaced to WORKSPACE. |
   | Use policy | Select this check box to enter the name of the policy to be used<br>by your Job cluster. You can use a policy to limit the ability to<br>configure clusters based on a set of rules.<br><br>For more information<br>about cluster policies, see [Manage cluster policies](https://docs.databricks.com/administration-guide/clusters/policies.html#:~:text=A%20cluster%20policy%20limits%20the,a%20specific%20users%20and%20groups.&text=Limit%20users%20to%20create%20clusters%20with%20prescribed%20settings.)<br>from the official Databricks documentation. |
   | Use DBFS to upload dependencies | Select this check box to upload dependencies to DBFS. |
   | Enable ACL | Select this check box to use access control lists (ACLs) to<br>configure permission to access workspace or account level<br>objects.<br><br>In ACL permission, you can configure<br>permission to access workspace objects with<br>CAN\_MANAGE,<br>CAN\_MANAGE\_RUN,<br>IS\_OWNER, or<br>CAN\_VIEW.<br><br>In ACL type, you can configure permission to<br>use account-level objects with User,<br>Group, or Service<br>Principal.<br><br>In Name, enter the name you were given by<br>the administrator.<br><br>This option is available when Cluster type<br>is set to Job clusters. For more<br>information, see the [Databricks<br>documentation](https://docs.databricks.com/aws/en/security/auth). |
   | Autoscale | Select or clear this check box to define the number of workers to<br>be used by your Job cluster. If you select this check box, autoscaling<br>is enabled. Then define the minimum number of workers in **Min<br>workers** and the maximum number of workers in **Max<br>workers**. Your Job cluster is scaled up and down in this scope<br>based on its workload.<br><br><ul> <li>If you select this check box, autoscaling is enabled. Then                                    define the minimum number of workers in <span>Min                                       workers</span> and the maximum number of workers in                                       <span>Max workers</span>. Your Job cluster is                                    scaled up and down in this scope based on its                                       workload.<p>According to the Databricks documentation,                                       autoscaling works best with Databricks runtime versions 3.0                                       or onwards.</p></li> <li>If you clear this check box, autoscaling is deactivated. Then                                    define the number of workers a Job cluster is expected to have.                                    This number does not include the Spark driver node.</li> </ul> |
   | Node type and Driver node<br>type | Select the node types for the workers and the Spark driver node.<br>These types determine the capacity of your nodes and their pricing by<br>Databricks.<br><br>For more information about these node types and the<br>Databricks Units they use, see [Supported Instance Types](https://databricks.com/product/aws-pricing/instance-types)<br>from the Databricks documentation. |
   | Enable credentials passthrough | Select this check box to disable user credential passthrough when<br>connecting to Databricks Universal. When this option is selected,<br>users' individual credentials are not used for authentication to data<br>sources. |
   | Configure cluster logs | Select this check box to define where to store your Spark logs for<br>a long term. |
   | Custom tags | Select this check box to add custom tags as key-value pairs to<br>your Databricks resources. |
   | Init scripts | DBFS is no longer supported as Init scripts<br>location. For all versions of Databricks, it was replaced to<br>WORKSPACE. |
   | Do not restart the cluster when submitting | Select this check box to prevent Talend Studio restarting the cluster when Talend Studio is submitting your Jobs. However, if you make changes in your Jobs,<br>clear this check box so that Talend Studio restarts your cluster to take these changes into account. |
6. Select the Set tuning properties check box to define the tuning parameters for your Spark Structured Streaming Job.

   Information noteImportant: You must define the tuning parameters otherwise you can get an error (400 - Bad request).
7. In the Advanced properties table, add any Spark properties you want to override the defaults set by Talend Studio.

## Results

The connection details are complete.