# tGSConfiguration properties for Apache Spark Batch

These properties are used to configure tGSConfiguration running in the Spark Batch Job framework.

The Spark Batch tGSConfiguration component belongs to the Storage family.

The component in this framework is available in all subscription-based Talend products with Big Data and Talend Data Fabric.

## Basic settings

When you use this component with Google Dataproc:

| Properties | Description |
| --- | --- |
| Google Storage bucket | Enter the name of the bucket to be used by the whole Job. Then the File components such as tFileInputDelimited or tFileOutputDelimited use the directories in this bucket.<br><br>For example, if you enter my\_bucket in this field and enter /user/ychen in the Folder field of tFileInputDelimited, tFileInputDelimited reads data from gs://my\_bucket/user/ychen. |

When you use this component with other distributions:

| Properties | Description |
| --- | --- |
| Project ID | Enter the ID of your Google Cloud Platform project.<br><br>If you are not certain about your project ID, confirm it in the Manage<br>Resources page of your Google Cloud Platform services. |
| Google Storage bucket | Enter the name of the bucket to be used by the whole Job. Then the File components such as tFileInputDelimited or tFileOutputDelimited use the directories in this bucket.<br><br>For example, if you enter my\_bucket in this field and enter /user/ychen in the Folder field of tFileInputDelimited, tFileInputDelimited reads data from gs://my\_bucket/user/ychen. |
| Use P12 credentials file format | When the Google credentials file to be used is in P12<br>format, select this check box and then in the Service account Id field that is displayed, enter the<br>ID of the service account for which this P12 credentials file has been<br>created. |
| Path to Google Credentials file | Enter the path to the credentials file associated to the<br>user account to be used. This file must be stored in the machine in<br>which your Talend<br>Job is actually launched and executed.<br><br>If you use Talend JobServer to run your Job, store the credentials file not only in the machine of the<br>Talend JobServer, in which the Job is launched, but also in the worker machines of the Spark<br>cluster, in which the Job is executed; if you do not use the Talend JobServer, store the credentials file in your local machine from which you launch the<br>Job and in the worker machines of the Spark cluster. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | You can use multiple tGSConfiguration components in one Job to provide<br>connection configuration to Google Storage.<br><br>For example, using two tGSConfiguration components in one Job allows you to use<br>different Google Storage buckets with different credentials. To use two<br>tGSConfiguration components, you need to set up the right permissions in the Google Storage console &gt; Bucket &gt; Permissions &gt; Roles.<br><br>For example, if you are working on:<br><br><ul> <li> <span>project-1234</span> with                              <span>userX@project-1234.iam.gserviceaccount.com</span> and                              <span>userX_bucket</span> </li> <li> <span>project-4567</span> with                              <span>userY@project-4567.iam.gserviceaccount.com</span> and                              <span>userY_bucket</span> </li> </ul><br><br><br>You will need to:<br><br><ul> <li>add <span>userX@project-1234.iam.gserviceaccount.com</span> as                              <span>Storage Admin</span> to <span>userY_bucket</span>                           and point to <span>project-4567</span> </li> <li>add <span>userY@project-4567.iam.gserviceaccount.com</span> as                              <span>Storage Admin</span> to <span>userX_bucket</span>                           and point to <span>project-4567</span> </li> </ul><br><br><br>For more information about IAM permissions, see the [Google Storage documentation](https://cloud.google.com/storage/docs/access-control/using-iam-permissions#console).<br><br>From R2022-12 onwards of Talend Studio<br>8.0, tGSConfiguration supports Spark Universal in the Local<br>mode and Databricks on Google Cloud Platform. |
| Spark Connection | In the Spark<br>Configuration tab in the Run<br>view, define the connection to a given Spark cluster for the whole Job. In<br>addition, since the Job expects its dependent jar files for execution, you must<br>specify the directory in the file system to which these jar files are<br>transferred so that Spark can access these files:<br><br><ul> <li> <div> <span>Yarn mode</span> (Yarn client or Yarn cluster):<ul> <li> <p>When using Google Dataproc, specify a bucket in the                                            <span>Google Storage staging bucket</span>                                        field in the <span>Spark configuration</span>                                        tab.</p> </li> <li> <p>When using HDInsight, specify the blob to be used for Job                                        deployment in the <span>Windows Azure Storage                                            configuration</span> area in the <span>Spark                                            configuration</span> tab.</p> </li> <li>When using Altus, specify the S3 bucket or the Azure                                    Data Lake Storage for Job deployment in the <span>Spark                                        configuration</span> tab.</li> <li> <p>When using on-premises distributions, use                                        the configuration component corresponding to the file system                                        your cluster is using. Typically, this system is HDFS and so                                        use <a href="https://help.qlik.com/talend/r/en-US/8.0/components/hdfs/thdfsconfiguration">tHDFSConfiguration</a>.</p> </li> </ul> </div> </li> <li> <p> <span>Standalone mode</span>: use the                            configuration component corresponding to the file system your cluster is                            using, such as <a href="https://help.qlik.com/talend/r/en-US/8.0/components/hdfs/thdfsconfiguration-properties-for-apache-spark-batch">tHDFSConfiguration Apache Spark Batch</a> or <a href="https://help.qlik.com/talend/r/en-US/8.0/components/amazon-s3/ts3configuration-properties-for-apache-spark-batch">tS3Configuration Apache Spark Batch</a>.</p> <p>If you are using Databricks without any configuration component present                            in your Job, your business data is written directly in DBFS (Databricks                            Filesystem).</p> </li> </ul><br><br>This connection is effective on a per-Job basis. |