# tDataUnmasking properties for Apache Spark Batch

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

The Spark Batch tDataUnmasking component belongs to the Data Quality family.

This component is available in Talend Real-Time Big Data Platform and Talend Data Fabric.

## Basic settings

| Properties | Description |
| --- | --- |
| Schema and Edit Schema | <ul> <li> <p>A schema is a row description. It defines the number of fields            (columns) to be processed and passed on to the next component. When you create a Spark            Job, avoid the reserved word <kbd>line</kbd> when naming the            fields.</p> <p>Click <span>Sync        columns</span> to retrieve the schema from the previous component connected in the      Job.</p> <p>Click <span>Edit        schema</span> to make changes to the schema. If the current schema is of the <span>Repository</span> type, three options are available:</p> <ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul> <p>The output schema of this component contains one read-only column, <em>ORIGINAL_MARK</em>. This column identifies by <span>true</span> or <span>false</span> if the record is an original record or a substitute record respectively.</p> </li> <li> <p> <span>Built-In</span>: You create and store the schema locally for this component                only.</p> </li> <li> <p> <span>Repository</span>: You have already created the schema and stored it in the                Repository. You can reuse it in various projects and Job designs.</p> </li> </ul> |
| Modifications | Define in the table what fields to unmask and how to<br>unmask them:<br><br><br>Input Column:<br>Select the column from the input flow that contains the data to be<br>unmasked.<br><br>You can unmask all data masked with tDataMasking using the FF1 with AES or<br>FF1 with SHA-2 method combined with a user-defined password.<br><br>These modifications are based on the function you select<br>in the Function column.<br><br><br>Category: select<br>a category of unmasking functions from the list.<br><br><br>Function:<br>Select the function that will unmask data.<br><br>The functions you can select from the Function list<br>depend on the data type of the input column.<br><br><br>Method: From<br>this list, select the Format-Preserving Encryption (FPE) algorithm that<br>was used to mask data, FF1 with<br>AES or FF1 with<br>SHA-2:<br><br>The FF1 with AES<br>method is based on the Advanced Encryption Standard in CBC mode. The<br>FF1 with SHA-2 method<br>depends on the secure hash function HMAC-256.<br><br>Java 8u161 is the minimum required version to use the<br>FF1 with AES method. To be<br>able to use this FPE method with Java versions earlier than 8u161,<br>download the Java Cryptography Extension (JCE) unlimited strength<br>jurisdiction policy files from Oracle website.<br><br>To unmask data, the FF1 with AES and<br>FF1 with SHA-2 methods require the password specified<br>in Password or 256-bit key for FF1 methods when the data<br>was masked with the tDataMasking component.<br><br>When using the Character<br>handling functions, such as Replace all,<br>Replace characters between two positions,<br>Replace all digits with FPE methods, you must select<br>an alphabet.<br><br>From the Alphabet list, select the alphabet used<br>to mask data with the tDataMasking component.<br><br><br>Extra Parameter: This field is used<br>by some of the functions, it will be disabled when not applicable. When applicable,<br>enter a number or a letter to decide the behavior of the function you have<br>selected.<br><br><br>Keep<br>format: this function is only used on Strings. Select this check box to<br>keep the input format when using the Bank Account<br>Unmasking, Credit Card<br>Unmasking, Phone Unmasking and<br>SSN Unmasking categories. That is to say, if<br>there are spaces, dots ('.'), hyphens ('-') or slashes ('/') in the input, those<br>characters are kept in the output. If you select this check box when using Phone Unmasking functions, the characters that are not<br>numbers from the input are copied to the output as is. |

## Advanced settings

| Properties | Description |
| --- | --- |
| FF1 settings | Password or 256-bit key for FF1 methods: To unmask data,<br>the FF1 with AES and FF1 with SHA-2 methods require the password or secret key<br>specified in the Password or 256-bit key for FF1 methods<br>when the data was masked with the tDataMasking component.<br><br><br>Use tweaks: If tweaks have been generated while masking the data,<br>select this check box. When selected, the Column containing<br>tweaks list is displayed. A tweak allows to unmask all<br>data of a record.<br><br><br>Column containing the tweaks: Available when the Use tweaks<br>check box is selected. Select the column that contains the tweaks. If you do<br>not see it, make sure you have declared in the input component the tweaks<br>generated by the masking component.<br><br><br><br>Key derivation function<br>: Select the same key derivation function as to mask<br>the data. By default, PBKDF2 with 300,000 iterations<br>is selected. |
| Output the original row | Select this check box to output masked data rows in addition to the original<br>data. Having both data rows can be useful in debug or test processes. |
| Null input returns null | This check box is selected by default. When selected, the component outputs<br>null when input values are null.<br><br>When cleared, and when the input data is null, the masking<br>function applies:<br><br><ul> <li>The Character Handling functions return the default value depending on                           the data type:<ul> <li>String: Empty output.</li> <li>Numeric input: <samp>0</samp>.</li> </ul></li> <li>The validation functions (Phone Unmasking, Credit Card Unmasking, SSN                           Unmasking, and Bank Account Unmasking) cannot validate the value. The                           data are sent to the "Invalid" output flow.</li> </ul><br><br>From Talend Studio<br>R2024-08 onwards, when Null input returns null is selected<br>and the input data is null, the masking function is not applied,<br>null is returned and the input data are sent to the main flow. |
| Empty input returns an empty output | When this check box is selected, the component returns the input values if they<br>are empty. Otherwise, the selected functions are applied to the input data. |
| Send invalid data to "Invalid" output flow | This check box is selected by default.<br><br><ul> <li>Selected: When the data can be unmasked, they are sent to the                                          main flow. Otherwise, the data are sent to the "Invalid" output flow.</li> <li>Cleared: The data are sent to the main flow.</li> </ul><br><br><br>The data are considered invalid when:<br><br><ul> <li>The format of the SSN, phone number or email address is incorrect,                        regardless of the <span>Method</span> used.</li> <li>They do not comply to the <a href="https://help.qlik.com/talend/r/en-US/8.0/components/data-privacy/data-masking-functions-in-masking-components"><span>FF1 with AES</span> and                              <span>FF1 with SHA-2</span> methods</a>.</li> </ul> |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is used as an intermediate step.<br><br>This component, along with the Spark Batch component Palette it belongs to,<br>appears only when you are creating a Spark Batch Job.<br><br>Note that in this documentation, unless otherwise explicitly stated, a<br>scenario presents only Standard Jobs, that is to<br>say traditional<br>Talend<br>data integration Jobs. |
| 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. |