# tHDFSPut

Connects to Hadoop distributed file system to load large-scale files into it with optimized performance.

tHDFSPut copies files from an user-defined directory, pastes them into a given Hadoop distributed file system(HDFS) and if needs be, renames these files.

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

## tHDFSPut Standard properties

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

The Standard tHDFSPut 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 |
| --- | --- |
| Property Type | Select the way the connection details<br>will be set.<br><br><ul> <li> <p> <span>Built-In</span>: The connection details will be set                                locally for this component. You need to specify the values for all                                related connection properties manually.</p> </li> <li> <p> <span>Repository</span>: The connection details stored                                centrally in <span><span>Repository</span><abbr> &gt; </abbr><span>Metadata</span></span> will be reused by this component. </p> <p>You need to click                                the <span>[...]</span> button next to it and in the pop-up                                    <span>Repository Content</span> dialog box, select the                                connection details to be reused, and all related connection                                properties will be automatically filled in.</p> </li> </ul> |
| *Use an existing connection* | Select this check box and in the Component List click the HDFS connection component from which<br>you want to reuse the connection details already defined.<br><br>Note that when a Job contains the parent Job and the child Job,<br>Component List presents only the<br>connection components in the same Job level. |
| Hadoop version | Select the Hadoop version of the distribution you are using. |
| Scheme | Select the URI scheme of the file system to be used from the<br>Scheme drop-down list. This scheme could be<br><br><ul> <li>HDFS</li> <li>WebHDFS. WebHDFS with SSL is not supported yet.</li> <li>ADLS. Only Azure Data Lake Storage Gen1 is supported.</li> </ul><br><br>The schemes present on this list vary depending on the distribution you<br>are using and only the scheme that appears on this list with a given<br>distribution is officially supported by Talend.<br><br>Once a scheme is<br>selected, the corresponding syntax such as<br>webhdfs://localhost:50070/ for WebHDFS is displayed in the<br>field for the NameNode location of your cluster.<br><br>If you have selected<br>ADLS, the connection parameters to be defined become:<br><br><ul> <li> <p> <span>In the <span>Client                                    ID</span> and the <span>Client                                    key</span> fields, enter, respectively, the authentication                                ID and the authentication key generated upon the registration of the                                application that the current Job you are developing uses to access                                Azure Data Lake Storage.</span> </p> <p>Ensure that the application to be used                            has appropriate permissions to access Azure Data Lake. You can check                            this on the Required permissions view of this application on Azure. For                            further information, see Azure documentation <a href="https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-service-to-service-authenticate-using-active-directory#step-3-assign-the-azure-ad-application-to-the-azure-data-lake-store-account-file-or-folder" target="_blank">Assign the Azure AD application to                                the Azure Data Lake Storage account file or folder</a>.</p> </li> <li> <p> <span>In the <span>Token                                    endpoint</span> field, copy-paste the OAuth 2.0 token                                endpoint that you can obtain from the <span>Endpoints</span> list accessible on the <span>App registrations</span> page on your                                Azure portal.</span> </p> </li> </ul><br><br><br>For a<br>video demonstration, see [Configure and use Azure in a<br>Job](https://www.youtube.com/watch?v=Ww9-sp5Kd1o). |
| Use Knox | Select this check box to enable support for Apache Knox when the<br>Scheme is set to WebHDFS. When<br>selected, additional Knox-specific options become available for secure gateway access.<br><br><ul> <li><span>Knox Gateway</span>: Enter the URL of the Knox gateway.</li> <li><span>User</span>: Enter the Knox username for authentication.</li> <li><span>Password</span>: Enter the Knox password for authentication.</li> <li><span>Set Knox timeout (s)</span>: Option to define a custom connection                  timeout. When enabled, the <span>Knox timeout</span> field appears.</li> </ul><br><br><br>The following options are hidden when Use Knox is<br>selected:<br><br><ul> <li><span>NameNode URI</span></li> <li><span>Use Datanode Hostname</span></li> <li><span>Use kerberos authentication</span></li> <li><span>User name</span></li> <li><span>Use MapR Ticket authentication</span></li> </ul> |
| 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. |
| 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>This check box is available depending on the Hadoop distribution you are<br>connecting to. |
| Use MapR Ticket authentication | Select this checkbox to authenticate using MapR Ticket, and enter the<br>following information:<br><br><ul> <li><span>User name</span>: Enter your username.</li> <li><span>Group</span>: Enter the name of the group.</li> <li><span>Password</span>: Enter your password to authenticate to                                MapR Ticket.</li> <li><span>Cluster name</span>: Enter the name of the cluster you want                                to use.</li> <li><span>Ticket duration</span>: Enter the duration of the ticket in seconds. For example:                                <span>86400L</span>, where <span>L</span> corresponds to a                                long integer.</li> </ul> |
| 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. |
| User name | The User name field is available when you<br>are not using Kerberos to authenticate. In the User<br>name field, enter the login username for your distribution. If you leave<br>it empty, the username of the machine hosting Talend Studio will<br>be used. |
| Group | Enter the membership including the authentication user under which the HDFS instances were<br>started. This field is available depending on the distribution you are using. |
| Local directory | Local directory where are stored the files to be loaded into HDFS. |
| HDFS directory | Browse to, or enter the path pointing to the data to be used in the file system. |
| Action on File | Select the action that you want to perform on the file:<br><br><ul> <li> <span>Create</span>: Create a new file.</li> <li> <span>Overwrite</span>: Overwrite the data in the existing                        file.</li> </ul> |
| Use Perl5 Regex Expression as Filemask | Select this check box if you want to use Perl5 regular expressions in the Files field as file<br>filters. This is useful when the name of the file to be used contains special characters<br>such as parentheses.<br><br>For information about Perl5 regular expression syntax, see [Perl5 Regular Expression Syntax](http://perldoc.perl.org/perlre.html#Regular-Expressions). |
| Files | In the Files area, the fields to be completed are:<br><br><ul> <li><span>File mask</span>: type in the file name to be selected from                        the local directory. Regular expression is available.</li> <li><span>New name</span>: give a new name to the loaded file.</li> </ul> |
| Die on error | This check box is selected by default. Clear the check box to skip the row<br>on error and complete the process for error-free rows. |

## Advanced settings

| Properties | Description |
| --- | --- |
| tStatCatcher Statistics | Select this check box to collect log data at the component level. |
| 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> |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | NB\_FILE: the number of files processed. This is an After variable and<br>it returns an integer.<br><br><br>TRANSFER\_MESSAGES: file transferred information. This is an After<br>variable and it returns a string.<br><br><br>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** | This component combines HDFS connection and data extraction, thus usually<br>used as a single-component subJob to move data from a user-defined local directory<br>to HDFS.<br><br>Different from the tHDFSInput and the<br>tHDFSOutput components, it runs<br>standalone and does not generate input or output flow for the other<br>components.<br><br>It<br>is often connected to the Job using OnSubjobOk or<br>OnComponentOk link, depending on the<br>context. |
| Dynamic settings | Click the [+] button to add a row in the<br>table and fill the Code field with a context variable<br>to choose your HDFS connection dynamically from multiple connections planned in your<br>Job. This feature is useful when you need to access files in different HDFS systems or<br>different distributions, especially when you are working in an environment where you<br>cannot change your Job settings, for example, when your Job has to be deployed and<br>executed independent of *Talend Studio*.<br><br>The Dynamic settings table is<br>available only when the Use an existing<br>connection check box is selected in the Basic settings view. Once a dynamic parameter is<br>defined, the Component List box in the<br>Basic settings view becomes unusable.<br><br>For examples on using dynamic parameters, see [Reading data from databases through<br>context-based dynamic connections](https://help.qlik.com/talend/r/en-US/8.0/components/defining-context-groups/reading-data-from-databases-through-context-based-dynamic-connections) and [Reading data from different MySQL databases<br>using dynamically loaded connection parameters](https://help.qlik.com/talend/r/en-US/8.0/components/context/reading-data-from-different-mysql-databases-using-dynamically-loaded-connection-parameters). For more information on<br>Dynamic settings and context variables, see<br>[Dynamic schema](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/dynamic-schema) and [Creating a context group and define context<br>variables in it](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/creating-context-group-and-define-context-variables-in-it). |
| 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. |
| Limitations | JRE 1.6+ is required. |

**Related concepts**

* [Computing data with Hadoop distributed file system](https://help.qlik.com/talend/en-US/components/8.0/hdfs/thdfsget-thdfsput-tfileinputdelimited-tlogrow-computing-data-with-hadoop-distributed-file-system-standard-component-bigdata-the)