# tMatchPairing

Enables you to compute pairs of suspect duplicates from any source data including large volumes in the context of machine learning on Spark.

This component reads a data set row by row, excludes unique rows and exact duplicates in separate files, computes pairs of suspect records based on a blocking key definition and creates a sample of suspect records representative of the data set.

You can label suspect pairs manually or load them into a Grouping campaign which is already defined in Talend Data Stewardship.

In local mode, Apache Spark 2.4.0 and later versions are supported.

This component is not shipped with your Talend Studio by default. You need to install it using the Feature Manager. For more information, see [Installing features using the Feature Manager](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/install-features-to-talend-studio).

## tMatchPairing properties for Apache Spark Batch

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

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

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

## Basic settings

| Properties | Description |
| --- | --- |
| Define a storage configuration<br>component | Select the configuration component to be used to provide the configuration<br>information for the connection to the target file system such as HDFS.<br><br>If you leave this check box clear, the target file system is the local<br>system.<br><br>The configuration component to be used must be present in the same Job.<br>For example, if you have dropped a tHDFSConfiguration component in the Job, you can select it to write<br>the result in a given HDFS system. |
| 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 has read-only columns                            in its output links:</p> <p> <span>PAIR_ID</span> and                                <span>SCORE</span>: used only with the <span>Pairs</span> and <span>Pairs sample</span> output links. The first column holds the                            identifiers of the suspect pairs, and the second holds the similarities                            between the records in each pair.</p> <p> <span>LABEL</span>: used only with the <em>Pairs sample</em> output link. You must fill in this                            column manually in the Job using the <span>tMatchModel</span> component.</p> <p> <span>COUNT</span>: used only with the <em>Exact duplicates</em> output link. This column gives                            the occurrences of the records which exactly match.</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> |
| Blocking key | Select the columns with which you want to construct the<br>blocking key.<br><br>This blocking key is used to generate suffixes which are<br>used to group records. |
| Suffix array blocking parameters | Min suffix length: Set the<br>minimum suffix length you want to reach or stop at in each group.<br><br><br>Max block size: Set the maximum<br>number of the records you want to have in each block. This helps in<br>filtering in large blocks where the suffix is too common, as with *tion* and *ing* for<br>example. |
| Pairing model location | Folder: Set the path to the local<br>folder where you want to generate the model files.<br><br>If you want to store the model in a specific file system,<br>for example S3 or HDFS, you must use the corresponding component in the<br>Job and select the Define a storage<br>configuration component check box in the component basic<br>settings.<br><br>The button for browsing does not work with the Spark Local mode; if you are using the other Spark Yarn modes that Talend Studio<br>supports with your distribution, ensure that you have properly configured the connection<br>in a configuration component in the same Job. Use the configuration component depending<br>on the filesystem to be used. |
| Integration with Data Stewardship | Select this check box to set the connection parameters to the Talend Data Stewardship<br>server.<br><br>If you select this check box, tMatchPairing loads the<br>suspect pairs into a Grouping campaign, which means this component is<br>used as an end component. |
| Data Stewardship Configuration | <ul> <li> <p> <span>URL</span>:</p> <p>Enter the address to access the <span>Talend Data Stewardship</span> server suffixed with                <em>/data-stewardship/</em>, for example                <kbd>http://&lt;server_address&gt;:19999/data-stewardship/</kbd>.</p> </li> <li> <div> <p>If you are working with <span>Talend Cloud Data Stewardship</span>, use the URL for the                corresponding data center suffixed with <em>/data-stewardship/</em> to access the                application, for example, <kbd>https://tds.us.cloud.talend.com/data-stewardship</kbd> for the AWS US                data center.</p> <p>For the URLs of available data             centers, see <a href="https://help.qlik.com/talend/en-US/installation-guide-windows/Cloud/talend-cloud-application-url" target="_blank">Accessing Talend Cloud applications</a>.</p> </div> </li> <li> <p> <span>Username</span> and                                    <span>Password</span>:</p> <p>Enter the authentication information to log in to <span>Talend Data Stewardship</span>.</p> <div>If you are working with <span>Talend Cloud Data Stewardship</span> and if: <ul> <li>SSO is enabled, enter an access					token in the field.</li> <li>SSO is not enabled, enter either					an access token or your password in the field.</li> </ul> </div> </li> <li> <p> <span>Campaign</span>:</p> <p>Displays the technical name of the campaign once it is selected            in the basic settings. However, you can modify the field value to replace it with a            context parameter for example and pass context variables to the Job at runtime. This            technical name is always used to identify a campaign when the Job communicates with                <span>Talend Data Stewardship</span> whatever is the value in the <span>Campaign</span>            field.</p> <p>Click <span>Find a Campaign</span> to open a dialog box                                    which lists the grouping campaigns on the server for which you                                    are the <span>Campaign owner</span> or you have the                                    access rights.</p> <p>Click the refresh button to retrieve the campaign details from                                    the <span> <span>Talend Data Stewardship</span> </span> server.</p> </li> <li> <p> <span>Assignee</span>:</p> <p>Specify the campaign participant whose tasks you want to                                    create.</p> </li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| Filtering threshold | Enter a value between 0.2 and 0.85 to filter the pairs of<br>suspect records based on the calculated scores. This value helps to<br>exclude the pairs which are not very similar.<br><br>0.3 is the default value. The higher the value is, the<br>more similar the records will be. |
| Pairs sample | Number of pairs: Enter a size for<br>the sample of the suspect pairs you want to generate. The default value<br>is set to 10000.<br><br><br>Set a random seed: Select this<br>check box and in the Seed field<br>that is displayed, enter a random number if you want to have the same<br>pairs sample in different executions of the Job. Repeating the execution<br>with a different value for the seed will result in different pairs<br>samples and the scores of the pairs could be different as well depending<br>whether the total number of the suspect pairs is greater than 10 000 or<br>not. |
| Data Stewardship Configuration | Campaign ID:<br><br>Displays the technical name of the campaign once it is selected<br>in the basic settings. However, you can modify the field value to replace it with a<br>context parameter for example and pass context variables to the Job at runtime. This<br>technical name is always used to identify a campaign when the Job communicates with<br>Talend Data Stewardship whatever is the value in the Campaign<br>field.<br><br><br>Max tasks per commit: Set the number of lines you<br>want to have in each commit.<br><br>Do not change the default value unless you are facing performance issues.<br>Increasing the commit size can improve the performance but setting a too<br>high value could cause Job failures. |

## 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. |
| Spark Batch 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/hdfs/thdfsconfiguration" target="_blank">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/hdfs/thdfsconfiguration-properties-for-apache-spark-batch" target="_blank">tHDFSConfiguration Apache Spark Batch</a> or <a href="https://help.qlik.com/talend/r/en-US/8.0/amazon-s3/ts3configuration-properties-for-apache-spark-batch" target="_blank">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. |