# tHDFSInput

Extracts the data in a HDFS file for other components to process it.

tHDFSInput reads a file located on a given Hadoop distributed file system (HDFS) and puts the data of interest from this file into a Talend schema. Then it passes the data to the component that follows.

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

## tHDFSInput Standard properties

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

The Standard tHDFSInput 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> |
| 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>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> </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> |
| *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). |
| 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. |
| File Name | Browse to, or enter the path pointing to the data to be used in the file system.<br><br>If the path you set points to a folder, this component will read all of the<br>files stored in that folder. Furthermore, if sub-folders exist in that folder<br>and you need to read files in the sub-folders, select the Include<br>sub-directories if path is directory check box in the<br>Advanced settings view. |
| Type | Select the type of the file to be processed. The type of the file may be:<br><br><ul> <li> <p> <span>Text file</span>.</p> </li> <li> <p> <span>Sequence file</span>: a Hadoop sequence file                    consists of binary key/value pairs and is suitable for the Map/Reduce framework.                    For further information, see <a href="http://wiki.apache.org/hadoop/SequenceFile" target="_blank">http://wiki.apache.org/hadoop/SequenceFile</a>. </p> <p>Once you select the <span>Sequence file</span> format, the                        <span>Key column</span> list and the <span>Value column</span> list appear to allow you to select the                    keys and the values of that Sequence file to be processed.</p> </li> </ul> |
| Row separator | The separator used to identify the end of a row.<br><br>This field is not available for a Sequence file. |
| Field separator | Enter a character, a string, or a regular expression to separate<br>fields for the transferred data.<br><br>This field is not available for a Sequence file. |
| Header | Set values to ignore the header of the transferred data. For example, enter<br>*0* to ignore no rows for the data without header and set *1* for the<br>data with header at the first row.<br><br>This field is not available for a Sequence<br>file. |
| Custom encoding | You may encounter encoding issues when you process the stored data. In that<br>situation, select this check box to display the Encoding list.<br><br>Select the encoding from the list or select Custom<br>and define it manually. This field is compulsory for database data handling. The<br>supported encodings depend on the JVM that you are using. For more information, see<br>[https://docs.oracle.com](https://docs.oracle.com/).<br><br>This option is not available for a Sequence file. |
| Compression | Select the Uncompress the data check box to uncompress<br>the input data.<br><br>Hadoop provides different compression formats that help reduce the space needed<br>for storing files and speed up data transfer. When reading a compressed file, Talend Studio needs to<br>uncompress it before being able to feed it to the input flow.<br><br>This option is not available for a Sequence file. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Include sub-directories if path is directory | Select this check box to read not only the folder you have specified in the<br>File name field but also the sub-folders in that<br>folder. |
| 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> |
| tStatCatcher Statistics | Select this check box to collect log data at the component level. Note that<br>this check box is not available in the Map/Reduce version of the<br>component. |

## 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** | This component needs an output link. |
| 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**

* [Using HDFS components to work with Azure Data Lake Storage (ADLS)](https://help.qlik.com/talend/en-US/components/8.0/hdfs/thdfsinput-thdfsoutput-tlogrow-tfixedflowinput-using-hdfs-components-to-work-with-azure-data-lake-storage-adls "This scenario describes how to use the HDFS components to read data from and write data to Azure Data Lake Storage.")