# Defining Databricks connection parameters with Spark Universal

## About this task

Talend Studio connects to an all-purpose Databricks cluster to run the Job from this cluster.

## Procedure

1. Click the Run view beneath the design workspace, then click the Spark configuration view.
2. Select Built-in from the Property type drop-down list.

   If you have already set up the connection parameters in the Repository as explained in [Centralizing a Hadoop connection](https://help.qlik.com/talend/en-US/studio-user-guide/8.0-R2026-09/Centralizing%20a%20Hadoop%20connection/talend/en-US/studio-user-guide/8.0/centralizing-hadoop-connection), you can easily reuse it. To do this, select Repository from the Property type drop-down list, then click […] button to open the Repository Content dialog box and select the Hadoop connection to be used.

   Information noteTip: Setting up the connection in the Repository allows you to avoid configuring that connection each time you need it in the Spark configuration view of your Jobs. The fields are automatically filled.
3. Select Universal from the Distribution drop-down list, the Spark version from the Version drop-down list, and Databricks from the Runtime mode/environment drop-down list.
4. Enter the basic configuration information:
   | Parameter | Usage |
   | --- | --- |
   | Use local timezone | Select this check box to let Spark use the local time<br>zone provided by the system.<br><br>Information noteNote:<br><br><ul> <li>If you clear this check box, Spark use UTC time                                                  zone.</li> <li>Some components also have the <span>Use                                                  local timezone for date</span> check box. If                                                  you clear the check box from the component, it                                                  inherits time zone from the Spark                                                  configuration.</li> </ul> |
   | Use dataset API in migrated<br>components | Select this check box to let the components use Dataset<br>(DS) API instead of Resilient Distributed Dataset (RDD) API:<br><br><ul> <li>If you select the check box, the components inside                                                the Job run with DS which improves performance.</li> <li>If you clear the check box, the components inside                                                the Job run with RDD which means the Job remains                                                unchanged. This ensures the backwards                                                compatibility.</li> </ul><br><br>This check box is selected by default, but if you import a Job from 7.3 backwards, the<br>check box will be cleared as those Jobs run with RDD.<br><br>Information noteImportant: If your Job contains tDeltaLakeInput<br>and tDeltaLakeOutput components, you must select this<br>check box. |
   | Use timestamp for dataset components | Select this check box to use<br>java.sql.Timestamp for dates.<br><br>Information noteNote: If<br>you leave this check box clear,<br>java.sql.Timestamp or<br>java.sql.Date can be used depending<br>on the pattern. |
   | Parallelize output files writing | Select this checkbox to enable the Spark Batch Job to run multiple<br>threads in parallel when writing output files. This option improves the<br>performance of the execution time.<br><br>When you leave this checkbox<br>cleared, the output files are written sequentially in one<br>thread.<br><br>On subJobs level, each subJob is treated sequentially.<br>Only the output file inside the subJob is parallelized.<br><br>This<br>option is only available for Spark Batch Jobs containing the<br>following output components:<br><br><ul> <li>tAvroOutput</li> <li>tFileOutputDelimited (only when the <span>Use dataset                                            API in migrated components</span> checkbox is                                        selected)</li> <li>tFileOutputParquet</li> </ul><br><br>Information noteImportant: To avoid memory<br>problems during the execution of the Job, you need to take into<br>account the size of the files being written and the execution<br>environment capacity before using this<br>parameter. |
5. Complete the Databricks configuration parameters:
   | Parameter | Usage |
   | --- | --- |
   | Cloud provider | Select the cloud provider to be used between<br>AWS, Azure<br>and GCP. |
   | Run mode | Select the mode you want to use to run your Job on<br>Databricks cluster when you execute your Job in Talend Studio. With Create and run now, a new<br>Job is created and run immediately on Databricks and with<br>Runs submit, a one-time run is<br>submitted without creating a 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<br>ID is the value of the<br>spark.databricks.clusterUsageTags.clusterId<br>property of your Spark cluster. You can find this property<br>on the properties list in the<br>Environment tab in the<br>Spark UI view of your cluster. |
   | Authentication mode | Select the method to authenticate to Databricks in the drop-down<br>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<br>Databricks project is located.<br><br>This field is only<br>available when you select GCP<br>from the Cloud provider drop-down<br>list. |
   | Bucket | Enter the name of the bucket you use for Databricks from<br>Google Platform.<br><br>This field is only available when you<br>select GCP from the<br>Cloud provider drop-down<br>list. |
   | Workspace ID | Enter the ID of your Google Platform workspace respecting<br>the following format:<br>databricks-workspaceid.<br><br>This<br>field is only available when you select<br>GCP from the Cloud<br>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. |
   | 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<br>can configure permission to access workspace objects with<br>CAN\_MANAGE,<br>CAN\_MANAGE\_RUN,<br>IS\_OWNER, or<br>CAN\_VIEW.<br><br>In ACL<br>type, you can configure permission to use account-level<br>objects with User,<br>Group, or Service<br>Principal.<br><br>In Name, enter<br>the name you were given by the administrator.<br><br>This option is<br>available when Cluster type is set to<br>Job clusters. For more information, see the<br>[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. |
   | Number of on-demand | Select this check box to specify the maximum number of on-demand<br>compute resources (such as virtual machines or worker nodes). |
   | Spot with fall back to On-demand | Select this check box to allow the use of Spot clusters with<br>automatic fallback to on-demand clusters if Spot resources are<br>unavailable. |
   | Availability zone | Select this check box to specify the availability zone in which<br>your Databricks resources will be deployed. |
   | Max spot price | Select this check box to specify the maximum price you are willing<br>to pay per hour for Spot instances when Databricks provisions compute<br>resources. |
   | EBS volume type | Choose the type of EBS volume from the drop-down menu between<br>None, General purpose<br>SSB and Throughput optimized<br>HDD. |
   | Configure instance profile ARN | Select this check box to specify the instance profile ARN to<br>assign custom permissions to your Databricks resources, enabling<br>secure access to AWS services as needed. |
   | Elastic disk | Select this check box to enable your Job cluster to automatically<br>scale up its disk space when its Spark workers are running low on disk<br>space.<br><br>For more details about this elastic disk feature, search<br>for the section about autoscaling local storage from your<br>Databricks documentation. |
   | SSH public key | If an SSH access has been set up for your cluster, enter the<br>public key of the generated SSH key pair. This public key is<br>automatically added to each node of your Job cluster. If no SSH access<br>has been set up, ignore this field.<br><br>For more information about SSH<br>access to your cluster, see [SSH access to clusters](https://docs.databricks.com/user-guide/clusters/ssh.html)<br>from the official Databricks documentation. |
   | 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<br>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, by following the process explained in [Tuning Spark for Apache Spark Batch Jobs](https://help.qlik.com/talend/en-US/components/8.0/spark-batch/tuning-spark-for-apache-spark-batch-jobs-spark-batch-component).

   Information noteImportant: You must define the tuning parameters otherwise you can get an error (400 - Bad request).
7. In the Spark "scratch" directory field, enter the local path where Talend Studio stores temporary files, like JARs to transfer.

   If you run the Job on Windows, the default disk is C:. Leaving /tmp in this field will use C:/tmp as the directory.
8. To make your Job resilient to failure, select Activate checkpointing to enable Spark’s checkpointing operation.

   In the Checkpoint directory field, enter the cluster file system path where Spark saves context data, such as metadata and generated RDDs.
9. In the Advanced properties table, add any Spark properties you want to override the defaults set by Talend Studio.

## Results

The connection details to the Databricks cluster are complete, you are ready to schedule executions of your Job or to run it immediately from this cluster.