# Defining Azure HDInsight connection parameters with Spark Universal

## About this task

Talend Studio connects to a HDInsight 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 Azure HDInsight from the Runtime mode/environment drop-down list.
4. Enter the basic configuration information to connect to HDInsight:
   1. Username: Enter your HDInsight cluster username.
   2. Password: Enter your HDInsight cluster password.
5. Enter the basic configuration information for Livy:
   1. Hostname: Enter the URL of your HDInsight cluster.
   2. Port: Enter the port number. The default one is 443.
   3. Username: Enter the username you defined when creating your cluster. You can find it in the SSH + Cluster login blade of your cluster.
6. Enter the Job status polling configuration:
   1. Poll interval when retrieving Job status (in ms): Enter the time interval (in milliseconds) at the end of which you want Talend Studio to ask Spark for the status of your Job.
   2. Maximum number of consecutive statuses missing: Enter the maximum number of times Talend Studio should retry to get a status when there is no status response.
7. Enter the configuration information for Windows Azure Storage:
   | Parameter | Usage |
   | --- | --- |
   | Primary storage | Select from the drop-down list the type of storage where you want<br>to deploy your Job:<br><br><ul> <li><span>ADLS Gen2</span></li> <li><span>Azure Storage</span></li> </ul> |
   | Authentication mode | Select from the drop-down list the authentication type you want to use:<br><br><ul> <li><span>Azure Active Directory</span></li> <li><span>Secret key</span></li> <li><span>Shared Access Signature</span></li> </ul> |
   | Hostname | Enter the Primary Blob Service Endpoint of your Azure Storage<br>account. You can find this endpoint in the<br>Properties blade of the storage<br>account. |
   | Container | Enter the name of the container to be used. You can find the<br>available containers in the Blob blade of the<br>Azure Storage account to be used. |
   | Directory ID | Enter the directory ID.<br><br>This parameter is only available when<br>you select Azure Active Directory from the<br>Authentication mode drop-down<br>list. |
   | Application ID | Enter the application ID.<br><br>This parameter is only available when<br>you select Azure Active Directory from the<br>Authentication mode drop-down<br>list. |
   | Client key | Enter the client key.<br><br>This parameter is only available when you<br>select Azure Active Directory from the<br>Authentication mode drop-down<br>list. |
   | SAS Token | Enter the shared access signature (SAS) token for your storage<br>container. For more information on how to generate the SAS token, see<br>[Create SAS tokens for your storage<br>containers](https://learn.microsoft.com/en-us/azure/ai-services/translator/document-translation/how-to-guides/create-sas-tokens?tabs=Containers) from the Microsoft documentation.<br><br>When you are<br>using the SAS token, you need to configure your cluster. For more<br>information, see [Use Azure Blob storage Shared<br>Access Signatures to restrict access to data in HDInsight](https://learn.microsoft.com/en-us/azure/hdinsight/hdinsight-storage-sharedaccesssignature-permissions)<br>from the Microsoft documentation.<br><br>This parameter is only<br>available when you select Shared Access<br>Signature from the Authentication<br>mode drop-down list. |
   | Deployment Blob | Enter the location in which you want to store the current Job and<br>its dependent libraries in the storage account. |
8. If you run your Spark Job on Windows, specify the location of the winutils.exe program:
   * If you want to use your own winutils.exe file, select the Define the Hadoop home directory check box and enter its folder path.
   * Otherwise, leave the Define the Hadoop home directory check box clear. Talend Studio will generate and use a directory automatically for this Job.
9. 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. |
10. 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).
11. 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.
12. 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.
13. In the Advanced properties table, add any Spark properties you want to override the defaults set by Talend Studio.
14. Select the Use Atlas check box to trace data lineage, view Spark Job components, and track schema changes between components.

    This option is only available for Spark Universal 3.3.x.

    With this option activated, you need to set the following parameters:
    * Atlas URL: Enter the address of your Atlas instance, such as http://name\_of\_your\_atlas\_node:port.

    * In the Username and Password fields, enter the authentication information for access to Atlas.

    * Set Atlas configuration folder: Select this check box if your Atlas cluster uses custom properties like SSL or read timeout. In the field that appears, enter the path to a local directory containing your atlas-application.properties file. Your Job will then use these custom properties.

      Ask the administrator of your cluster for this configuration file. For more information, see the Client Configs section in [Atlas configuration](https://atlas.apache.org/0.8.2/Configuration.html).

    * Die on error: Select this check box to stop Job execution if Atlas-related issues occur, such as connection errors. Clear it to let your Job continue running.

## Results

The connection details are complete, you are ready to schedule executions of your Spark Job or to run it immediately.