# tSqoopMerge (deprecated)

Availability-note[Deprecated](https://help.talend.com/r/en-US/Cloud/labels-on-talend-help-center/availability-deprecated)

This content is deprecated.

Information noteDeprecation: This component is deprecated since the 7.3.1-R2021-06 release.

Performs an incremental import that updates an older dataset with newer records. The file types of the newer and the older datasets must be the same.

tSqoopMerge reads two datasets in HDFS and combines them both using a merge class that is able to parse the datasets, with the newer records overwriting the older records.

Information noteNote:

Sqoop is typically installed in every Hadoop distribution. But if the Hadoop distribution you need to use have no Sqoop installed, you have to install one on your own and ensure to add the Sqoop command line to the PATH variable of that distribution. For further information about how to install Sqoop, see the documentation of Sqoop.

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).

## tSqoopMerge Standard properties

These properties are used to configure tSqoopMerge running in the Standard Job framework.

The Standard tSqoopMerge component belongs to the Big Data and the File families.

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

## Basic settings

| Properties | Description |
| --- | --- |
| Mode | Select the mode in which Sqoop is called in a Job execution.<br><br><br>Use Commandline: the Sqoop shell is used to call Sqoop.<br>You can read data from either HDFS or HCatalog. In this mode, you have to deploy and run<br>the Job in the host where Sqoop is installed. Therefore, if you are a subscription-based<br>user, we recommend installing and using a Talend JobServer provided<br>by Talend in that host to run the Job; if you are using one of the Talend solutions with Big Data, you have to ensure that Talend Studio and the<br>Sqoop to be used are in the same machine.<br><br><br>Use Java API: the Java API is used to call Sqoop. In<br>this mode, the Job can be run locally in Talend Studio but you<br>need to configure the connection to the Hadoop distribution to be used. Note that JDK is<br>required to execute the Job in the Java API mode and the versions of the JDK kits installed<br>in both machines must be compatible with each other; for example, the versions are the same<br>or the JDK version of the Hadoop machine is more recent. |
| Hadoop properties | Either Built-in or Repository:<br><br><ul> <li> <p> <span>Built-in</span>: you enter the configuration                  information of the Hadoop distribution to be used locally for this component                  only.</p> </li> <li> <p> <span>Repository</span>: you have already created the                  Hadoop connection and stored it in the <span>Repository</span>; therefore, you reuse it directly for the component                  configuration and the Job design. For further information about how to create a                  centralized Hadoop connection, see <a href="https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/centralizing-hadoop-connection" target="_blank">Centralizing Hadoop connection                  metadata</a>.</p> </li> </ul> |
| Distribution | Select the cluster you are using from the drop-down list. The options in the<br>list vary depending on the component you are using. Among these options, the following<br>ones requires specific configuration:<br><br><ul> <li> <p>If available in this <span>Distribution</span> drop-down list, the <span>Microsoft HD Insight</span> option allows you to                        use a Microsoft HD Insight cluster. For this purpose, you need to configure                        the connections to the HD Insight cluster and the Windows Azure Storage                        service of that cluster in the areas that are displayed. For detailed                        explanation about these parameters, see <a href="https://help.qlik.com/talend/r/en-US/7.3/studio-user-guide/configuring-connection-manually" target="_blank">Configuring the connection                            manually</a>. </p> </li> <li> <p>If you select <span>Amazon EMR</span>,                        find more details in <a href="https://help.qlik.com/talend/r/en-US/8.0/amazon-emr-getting-started" target="_blank">Amazon EMR - Getting Started</a>.</p> </li> <li> <p>The <span>Custom</span> option                        allows you to connect to a cluster different from any of the distributions                        given in this list, that is to say, to connect to a cluster not officially                        supported by <span> <span>Talend</span> </span>.</p> </li> </ul><br><br><ol> <li> <p>Select <span>Import from existing                        version</span> to import an officially supported distribution as base                    and then add other required jar files which the base distribution does not                    provide.</p> </li> <li> <p>Select <span>Import from zip</span> to                    import the configuration zip for the custom distribution to be used. This zip                    file should contain the libraries of the different Hadoop elements and the index                    file of these libraries. </p> <p>Note that custom versions are not officially supported by                        <span> <span>Talend</span> </span>. <span> <span>Talend</span> </span> and its community provide you with the opportunity to connect to                    custom versions from <span>Talend Studio</span> but cannot guarantee that the configuration of whichever version you choose                    will be easy, due to the wide range of different Hadoop distributions and                    versions that are available. As such, you should only attempt to set up such a                    connection if you have sufficient Hadoop experience to handle any issues on your                    own.</p> <div><span>Information note</span><span>Note:</span> <p>In this dialog box, the active check box must be kept                        selected so as to import the jar files pertinent to the connection to be                        created between the custom distribution and this component.</p> </div> <p>For a step-by-step example about how to connect to a custom                    distribution and share this connection, see <a href="https://help.qlik.com/talend/r/en-US/8.0/hortonworks" target="_blank">Hortonworks</a>.</p> </li> </ol> |
| Hadoop Version | Select the HBase version of the distribution you are using. |
| NameNode URI | Type in the URI of the Hadoop NameNode, the master node of a<br>Hadoop system. For example, we assume that you have chosen a machine called *masternode* as the NameNode, then the location is<br>hdfs://masternode:portnumber. If you are using WebHDFS, the location should be<br>webhdfs://masternode:portnumber; WebHDFS with SSL is not<br>supported yet. |
| JobTracker Host | Select this check box and in the displayed field, enter the location of the<br>ResourceManager of your distribution. For example, tal-qa114.talend.lan:8050.<br><br>This property is required when the query you want to use is executed in<br>Windows and it is a Select query. For example, SELECT your\_column\_name FROM your\_table\_name<br><br>Then you can continue to set the following parameters depending on the<br>configuration of the Hadoop cluster to be used (if you leave the check box of a<br>parameter clear, then at runtime, the configuration about this parameter in the<br>Hadoop cluster to be used will be ignored ):<br><br><ol> <li> <p>Select the <span>Set resourcemanager                        scheduler address</span> check box and enter the Scheduler address in                    the field that appears.</p> </li> <li> <p>Select the <span>Set jobhistory                        address</span> check box and enter the location of the JobHistory                    server of the Hadoop cluster to be used. This allows the metrics information of                    the current Job to be stored in that JobHistory server.</p> </li> <li> <p>Select the <span>Set staging                        directory</span> check box and enter this directory defined in your                    Hadoop cluster for temporary files created by running programs. Typically, this                    directory can be found under the <em>yarn.app.mapreduce.am.staging-dir</em> property in the configuration files                    such as <em>yarn-site.xml</em> or <em>mapred-site.xml</em> of your distribution.</p> </li> <li> <p>Allocate proper memory volumes to the <span>Map</span> and the <span>Reduce</span>                    computations and the <span>ApplicationMaster</span>                    of YARN by selecting the <span>Set memory</span>                    check box in the <span>Advanced settings</span>                    view.</p> </li> <li> <p>Select the <span>Set Hadoop                                user</span> check box and enter the user name under which you                            want to execute the Job. Since a file or a directory in Hadoop has its                            specific owner with appropriate read or write rights, this field allows                            you to execute the Job directly under the user name that has the                            appropriate rights to access the file or directory to be processed.</p> </li> <li> <p>Select the <span>Use datanode hostname</span> check box to allow the                    Job to access datanodes via their hostnames. This actually sets the <em>dfs.client.use.datanode.hostname</em>                    property to <em>true</em>. When connecting to a                    S3N filesystem, you must select this check box.</p> </li> </ol><br><br><br>For further information about these parameters, see the documentation or<br>contact the administrator of the Hadoop cluster to be used.<br><br>For further information about the Hadoop Map/Reduce framework, see the<br>Map/Reduce tutorial in [Apache's Hadoop documentation](http://hadoop.apache.org/). |
| Use kerberos authentication | If you are accessing the Hadoop cluster running with<br>Kerberos security, select this checkbox, then, enter the Kerberos principal name<br>for the NameNode in the field displayed. This enables you to use your username<br>to authenticate against the credentials stored in Kerberos.<br><br>In addition, since this component performs Map/Reduce computations, you<br>also need to authenticate the related services such as the Job history server and<br>the Resource manager or JobTracker depending on your distribution in the<br>corresponding field. These principals can be found in the configuration files of<br>your distribution. For example, in a CDH4 distribution, the Resource manager<br>principal is set in the *yarn-site.xml* file and the Job history<br>principal in the *mapred-site.xml* file.<br><br>This check box is available depending on the Hadoop distribution you are<br>connecting to. |
| Use a keytab to authenticate | Select the Use a keytab to authenticate<br>checkbox to log into a Kerberos-enabled system using a given keytab file. A keytab<br>file contains pairs of Kerberos principals and encrypted keys. You need to enter the<br>principal to be used in the Principal field and<br>the access path to the keytab file itself in the Keytab field. This keytab file must be stored in the machine in<br>which your Job actually runs, for example, on a Talend JobServer.<br><br>Note that the user that executes a keytab-enabled Job is not necessarily<br>the one a principal designates but must have the right to read the keytab file being<br>used. For example, the username you are using to execute a Job is *user1* and the principal to be used is *guest*; in this<br>situation, ensure that *user1* has the right to read the keytab<br>file to be used. |
| Hadoop user name | Enter the user name under which you want to execute the Job. Since a file or a directory in<br>Hadoop has its specific owner with appropriate read or write rights, this field allows you<br>to execute the Job directly under the user name that has the appropriate rights to access<br>the file or directory to be processed. Note that this field is available depending on the<br>distribution you are using. |
| Old data directory | Enter the path to the older dataset to be merged. |
| New data directory | Enter the path to the newer dataset to be merged. |
| Target directory | Enter the directory where you need to put the output of the<br>merging. |
| Merge key | Enter the name of the column used as the key of each record for<br>the merging.<br><br>This primary key must be unique. |
| Need to generate the JAR file | Select this check box to generate the merge jar file and the merge<br>class required to parse the datasets to be merged. The default name<br>of the jar file and the class is *SqoopMerge\_component\_ID*. This *compnent\_ID* is the ID of the tSqoopMerge component that generates the<br>jar file and the class, such as *tSqoopMerge\_1*, or *tSqoopMerge\_2*.<br><br>As this jar file is generated from the source table of the<br>imported data, selecting this check box displays the corresponding<br>parameters to be set for connecting to that table. |
| JDBC property | Either Built-in or Repository:<br><br><ul> <li> <p> <span>Built-in</span>: you enter the connection                  information of the database to be used locally for this component only.</p> </li> <li> <p> <span>Repository</span>: you have already created the                  database connection and stored it in the <span>Repository</span>; therefore, you reuse it directly for the component                  configuration and the Job design.</p> <p>Note that only the <span>General                     JDBC</span> connection stored in the <span>Repository</span> is supported.</p> </li> </ul> |
| Connection | Enter the JDBC URL used to connect to the database where the source data is<br>stored. |
| User name and<br>Password | Enter the authentication information used to connect to the source database.<br><br>To enter the password, click the [...] button<br>next to the password field, enter the password in double quotes in the pop-up dialog box,<br>and click OK to save the settings. |
| Table Name | Type in the name of the source table.<br><br>This name is used to name the generated jar file. |
| Driver JAR | In either the Use Commandline mode or the<br>Java API mode, you must add the driver file of the<br>database to be used to the *lib* folder of the Hadoop distribution you<br>are using. For that purpose, use this Driver JAR table<br>to add that driver file for the current Job you are designing.<br><br>This driver jar is required only when you need to connect to the<br>database to be used to generate the merge jar file; therefore this<br>Driver JAR table is available<br>only when you have selected the Need to<br>generate the JAR file check box. |
| JAR file | If a required merge class already exists and is available, specify<br>the access path to the jar file that contains that class for reusing<br>the class.<br><br>In this situation, you need to enter the name of the class in the<br>Class name field in the<br>Advanced settings tab. |
| Print Log | Select this check box to activate the Verbose<br>check box. |
| Verbose | Select this check box to print more information while working, for example, the<br>debugging information. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Custom class name | Select this check box to display the Class<br>name field and enter the name of the merge class you<br>need to use.<br><br>This check box must be clear if you use Generate the JAR file in the Basic settings tab. |
| Additional arguments | Complete this table to use additional arguments if needs be.<br><br>By adding additional arguments, you are able to perform multiple operations in<br>one single transaction. For example, you can use --hive-import and --hive-table in the Talend CommandLine mode or<br>hive.import and hive.table.name in the Java API mode to create Hive table and write data in at<br>the runtime of the transaction writing data in HDFS. For further information about the<br>available Sqoop arguments in the Talend CommandLine mode and<br>the Java API mode, respectively, see [Additional arguments](https://help.qlik.com/talend/en-US/components/8.0/sqoop/tsqoopexport-tsqoopexport-additional-arguments-standard-component-bigdata). |
| Hadoop properties | *Talend Studio* uses a default configuration for its engine to perform<br>operations in a Hadoop distribution. If you need to use a custom configuration in a specific<br>situation, complete this table with the property or properties to be customized. Then at<br>runtime, the customized property or properties will override those default ones.<br><br><ul> <li> <p>Note that if you are using the centrally stored metadata from the <span>Repository</span>, this table automatically inherits the					properties defined in that metadata and becomes uneditable unless you change the						<span>Property type</span> from <span>Repository</span> to <span>Built-in</span>.</p> </li> </ul><br><br>For further information about the properties required by Hadoop and its related<br>systems such as HDFS and Hive, see the documentation of the Hadoop distribution you are<br>using or see [Apache's Hadoop documentation](http://hadoop.apache.org/docs) and then select the version of the<br>documentation you want. For demonstration purposes, the links to some properties are listed<br>below:<br><br><ul> <li> <p>Typically, the HDFS-related properties can be found in the <em>hdfs-default.xml</em> file of your distribution, such as <a href="http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml" target="_blank">                     http://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml</a>.</p> </li> <li> <p>Apache also provides a page to list the <a href="https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties" target="_blank">Hive-related properties</a>.</p> </li> </ul> |
| Mapred job map memory mb and<br>Mapred job reduce memory<br>mb | You can tune the map and reduce computations by<br>selecting the Set memory check box to set proper memory allocations<br>for the computations to be performed by the Hadoop system.<br><br>In that situation, you need to enter the values you<br>need in the Mapred job map memory<br>mb and the Mapred job<br>reduce memory mb fields, respectively. By default, the values<br>are both *1024* which are normally<br>appropriate for running the computations.<br><br>The memory parameters to be set are Map (in Mb),<br>Reduce (in Mb) and ApplicationMaster (in Mb). These fields allow you to dynamically allocate<br>memory to the map and the reduce computations and the ApplicationMaster of YARN. |
| Path separator in server | Leave the default value of the Path separator in<br>server as it is, unless you have changed the separator used by your<br>Hadoop distribution's host machine for its PATH variable or in other words, that<br>separator is not a colon (:). In that situation, you must change this value to the<br>one you are using in that host. |
| tStatCatcher Statistics | Select this check box to collect log data at the component<br>level. |

## 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><br>EXIT\_CODE: the exit code of the remote command. This is<br>an After variable and it returns an integer.<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** | This component is used standalone. It respects the Sqoop prerequisites. You need<br>necessary knowledge about Sqoop to use it.<br><br><br>Talend<br>recommends you to use the Sqoop of version 1.4+ in order to benefit the full functions of<br>these components.<br><br>For further information about Sqoop, see the Sqoop manual on: http://sqoop.apache.org/docs/ |
| Prerequisites | The Hadoop distribution must be properly installed, so as to guarantee the interaction<br>with *Talend Studio*. The following list presents MapR related information for<br>example.<br><br><ul> <li> <p>Ensure that you have installed the MapR client in the machine where                  <span>Talend Studio</span> is,               and added the MapR client library to the PATH variable of that machine. According to               MapR's documentation, the library or libraries of a MapR client corresponding to each               OS version can be found under <em>MAPR_INSTALL\                  hadoop\hadoop-VERSION\lib\native</em>. For example, the library for Windows is <em>\lib\native\MapRClient.dll</em> in the MapR client jar file.</p> <p>Without adding the specified library or libraries, you may encounter the following				error: <span>no MapRClient in java.library.path</span>.</p> </li> <li> <p>Set the <span>-Djava.library.path</span> argument,               for example, in the <span>Job Run VM arguments</span> area               of the <span>Run/Debug</span> view in the <span>Preferences</span> dialog box in the <span>Window</span> menu. This argument provides to <span>Talend Studio</span> the               path to the native library of that MapR client. This allows the subscription-based               users to make full use of the <span>Data viewer</span> to               view locally in <span>Talend Studio</span> the               data stored in MapR.</p> </li> </ul><br><br>For further information about how to install a Hadoop distribution, see the manuals<br>corresponding to the Hadoop distribution you are using. |
| Limitation | If you have selected the Use Commandline<br>mode, you need to use the host where Sqoop is installed to run the Job using this<br>component. |
| Connections | Outgoing links (from this component to another):<br><br><br>Trigger: Run if; On Subjob Ok; On<br>Subjob Error; On Component Ok; On Component Error.<br><br>Incoming links (from one component to this one):<br><br><br>Row: Iterate;<br><br><br>Trigger: Run if; On Subjob Ok; On<br>Subjob Error; On Component Ok; On Component Error<br><br>For further information regarding connections, see [Using connections in a Job](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/using-connections-in-job). |

**Related concepts**

* [Merging two datasets in HDFS (deprecated)](https://help.qlik.com/talend/en-US/components/8.0/sqoop/tsqoopmerge-tsqoopimport-tsqoopimport-merging-two-datasets-in-hdfs-standard-component-bigdata-this)