
Component Family |
Big Data / Hive |
|||
Function |
tHiveConnection opens a |
|||
Purpose |
This component allows you to establish a Hive connection to be |
|||
Basic settings |
Property type |
Either Built-in or Repository. |
||
|
|
Built-in: No property data stored |
||
|
|
Repository: Select the repository |
||
Version |
Distribution |
Select the cluster you are using from the drop-down list. The options in the list vary
In order to connect to a custom distribution, once selecting Custom, click the
|
||
|
Hive version |
Select the version of the Hadoop distribution you are using. The available options vary
|
||
Connection |
Connection mode |
Select a connection mode from the list. The options vary depending |
||
Hive server |
Select the Hive server through which you want the Job using this component to execute This Hive server list is available only when the Hadoop For further information about HiveServer2, see https://cwiki.apache.org/confluence/display/Hive/Setting+Up+HiveServer2. |
|||
|
Host |
Database server IP address. |
||
|
Port |
DB server listening port. |
||
|
Database |
Fill this field with the name of the database. NoteThis field is not available when you select Embedded from the Connection mode list. |
||
|
Username |
DB user authentication data. To enter the password, click the […] button next to the |
||
Authentication |
Use kerberos authentication |
If you are accessing a Hive Metastore running with Kerberos security, select this check The values of the following parameters can be found in the hive-site.xml file of the Hive system to be used.
For the other parameters that are displayed, please consult the Hadoop This check box is available depending on the Hadoop distribution you are connecting |
||
Use a keytab to authenticate |
Select the Use a keytab to authenticate check box to log Note that the user that executes a keytab-enabled Job is not necessarily the one a |
|||
Use SSL encryption |
Select this check box to enable the SSL encrypted connection. Then in the fields that are displayed, provide the authentication information:
This feature is available only to the HiveServer2 in the Standalone mode of the following distributions:
|
|||
Hadoop properties |
Set Jobtracker URI |
Select this check box to indicate the location of the Jobtracker service within the Hadoop This property is required when the query you want to use is executed in Windows and it is If you use YARN in your Hadoop cluster such as Hortonworks Data
For further information about these parameters, see the documentation or For further information about the Hadoop Map/Reduce framework, see the Map/Reduce tutorial |
||
Set NameNode URI |
Select this check box to indicate the location of the NameNode of the Hadoop cluster to be This property is required when the query you want to use is executed in Windows and it is For further information about the Hadoop Map/Reduce framework, see the Map/Reduce tutorial |
|||
Microsoft HD Insight properties |
WebHCat configuration |
Enter the address and the authentication information of the WebHCat service of the Microsoft In the Job result folder field, enter the location in |
||
HDInsight configuration |
Enter the authentication information of the HD Insight cluster to be used. |
|||
Windows Azure Storage |
Enter the address and the authentication information of the Azure Storage account to be In the Container field, enter the name of the container In the Deployment Blob field, enter the location in which |
|||
|
Use or register a shared DB Connection |
Select this check box to share your connection or fetch a WarningThis option is incompatible with the Use dynamic job
Shared DB Connection Name: set or |
||
HBase Configuration |
Store by HBase |
Select this check box to display the parameters to be set to allow the Hive components to
For further information about this access involving Hive and HBase, see Apache’s Hive |
||
Zookeeper quorum |
Type in the name or the URL of the Zookeeper service you use to coordinate the transaction |
|||
Zookeeper client port |
Type in the number of the client listening port of the Zookeeper service you are |
|||
Define the jars to register for |
Select this check box to display the Register jar for |
|||
Register jar for HBase |
Click the |
|||
Advanced settings |
Hadoop properties |
Talend Studio uses a default configuration for its engine to perform
For further information about the properties required by Hadoop and its related systems such
|
||
Hive properties |
Talend Studio uses a default
|
|||
Mapred job map memory mb and |
If the Hadoop distribution to be used is Hortonworks Data Platform V1.2 or Hortonworks In that situation, you need to enter the values you need in the Mapred |
|||
Path separator in server |
Leave the default value of the Path separator in server as |
|||
tStatCatcher Statistics |
Select this check box to collect the log data at a component |
|||
Global Variables |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|||
Usage |
This component is generally used with other Hive components, If the Studio used to connect to a Hive database is operated on Windows, you must manually |
|||
Prerequisites |
The Hadoop distribution must be properly installed, so as to guarantee the interaction
For further information about how to install a Hadoop distribution, see the manuals |
|||
Log4j |
The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html. |
|||
Limitation |
n/a |
As explained in the properties table, when you select the Custom option from the Distribution
drop-down list, you are connecting to a Hadoop distribution different from any of the
Hadoop distributions provided on that Distribution list
in the Studio.
After selecting this Custom option, click the button to display the [Import custom
definition] dialog box and proceed as follows:
-
Depending on your situation, select Import from existing
version or Import from zip to
configure the custom Hadoop distribution to be connected to.-
If you have the zip file of the custom Hadoop distribution you need to
connect to, select Import from zip.
Talend community provides this kind of zip
files that you can download from http://www.talendforge.org/exchange/index.php. -
Otherwise, select Import from existing
version to import an officially supported Hadoop
distribution as base so as to customize it by following the wizard.
Note that the check boxes in the wizard allow you to select the Hadoop
element(s) you need to import. All the check boxes are not always displayed in
your wizard depending on the context in which you are creating the connection.
For example, if you are creating this connection for a Hive component, then only
the Hive check box appears. -
-
Whether you have selected Import from existing
version or Import from zip,
verify that each check box next to the Hadoop element you need to import has
been selected.. -
Click OK and then in the pop-up warning,
click Yes to accept overwriting any custom
setup of jar files previously implemented-.Once done, the [Custom Hadoop version
definition] dialog box becomes active.This dialog box lists the Hadoop elements and their jar files you are
importing. -
If you have selected Import from zip, click
OK to validate the imported
configuration.If you have selected Import from existing
version as base, you should still need to add more jar files to
customize that version. Then from the tab of the Hadoop element you need to
customize, for example, the HDFS/HCatalog/Oozie
tab, click the [+] button to open the [Select libraries] dialog box. -
Select the External libraries option to open
its view. -
Browse to and select any jar file you need to import.
-
Click OK to validate the changes and to close
the [Select libraries] dialog box.Once done, the selected jar file appears on the list in the tab of the Hadoop
element being configured.Note that if you need to share the custom Hadoop setup with another Studio,
you can export this custom connection from the [Custom
Hadoop version definition] window using thebutton.
-
In the [Custom Hadoop version definition]
dialog box, click OK to validate the customized
configuration. This brings you back to the Distribution list in the Basic
settings view of the component.
Now that the configuration of the custom Hadoop version has been set up and you are
back to the Distribution list, you are able to continue
to enter other parameters required by the connection.
If the custom Hadoop version you need to connect to contains YARN and you want to use
it, select the Use YARN check box next to the Distribution list.
This scenario illustrates how to use tHiveConnection,
tHiveCreateTable and tHiveLoad to create a partitioned Hive table and write data in
it.
Note that tHiveCreateTable and tHiveLoad are available only when you are using one of the Talend
solutions with Big Data.

The sample data to be used in this scenario is employee information of a company,
reading as follows:
1 2 3 4 5 6 7 8 9 10 |
1;Lyndon;Fillmore;21-05-2008;US 2;Ronald;McKinley;15-08-2008 3;Ulysses;Roosevelt;05-10-2008 4;Harry;Harrison;23-11-2007 5;Lyndon;Garfield;19-07-2007 6;James;Quincy;15-07-2008 7;Chester;Jackson;26-02-2008 8;Dwight;McKinley;16-07-2008 9;Jimmy;Johnson;23-12-2007 10;Herbert;Fillmore;03-04-2008 |
The information contains some employees’ names and the dates when they are registered
in a HR system. Since these employees work for the US subsidiary of the company, you
will create a US partition for this sample data.
Before starting to replicate this scenario, ensure that you have appropriate rights
and permissions to access the Hive database to be used.
Note that if you are using the Windows operating system, you have to create a
tmp folder at the root of the disk where the
Studio is installed.
Then proceed as follows:
-
In the Integration perspective
of the Studio, create an empty Job from the Job
Designs node in the Repository tree view.For further information about how to create a Job, see the chapter
describing how to designing a Job in Talend Studio
User Guide. -
Drop tHiveConnection, tHiveCreateTable and tHiveLoad onto the workspace.
-
Connect them using the Trigger > On Subjob
OK link.
Configuring tHiveConnection
-
Double-click tHiveConnection to open its
Component view. -
From the Property type list, select
Built-in. If you have created the
connection to be used in Repository, then
select Repository, click thebutton to open the [Repository
content] dialog box and select that connection. This way, the
Studio will reuse that set of connection information for this Job.For further information about how to create an Hadoop connection in
Repository, see the chapter describing the Hadoop
cluster node of the Talend Big Data Getting Started Guide. -
In the Version area, select the Hadoop
distribution to be used and its version. If you cannot find from the list
the distribution corresponding to yours, select Custom so as to connect to a Hadoop distribution not
officially supported in the Studio.For a step-by-step example about how to use this Custom option, see Connecting to a custom Hadoop distribution.
-
In the Connection area, enter the
connection parameters to the Hive database to be used. -
In the Name node field, enter the
location of the master node, the NameNode, of the distribution to be used.
For example, talend-hdp-all:50300. -
In the Job tracker field, enter the
location of the JobTracker of your distribution. For example, hdfs://talend-hdp-all:8020.Note that the notion Job in this term JobTracker designates the MR or the
MapReduce jobs described in Apache’s documentation on http://hadoop.apache.org/.
Defining the schema
-
Double-click tHiveCreateTable to open its
Component view. -
Select the Use an existing connection
check box and from Component list, select
the connection configured in the tHiveConnection component you are using for this Job. -
Click the
button next to Edit
schema to open the schema editor. -
Click the
button four times to add four rows and in the Column column, rename them to Id, FirstName, LastName and
Reg_date, respectively.Note that you cannot use the Hive reserved keywords to name the columns,
such as location or date. -
In the Type column, select the type of
the data in each column. In this scenario, Id is of the Integer type,
Reg_date is of the Date type and the others are of the String type. -
In the DB type column, select the Hive
type of each column corresponding to their data types you have defined. For
example, Id is of INT and Reg_date is of
TIMESTAMP. -
In the Data pattern column, define the
pattern corresponding to that of the raw data. In this example, use the
default one. -
Click OK to validate these
changes.
Defining the table settings
-
In Table name field, enter the name of
the Hive table to be created. In this scenario, it is employees. -
From the Action on table list, select
Create table if not exists. -
From the Format list, select the data
format that this Hive table in question is created for. In this scenario, it
is TEXTFILE. -
Select the Set partitions check box to
add the US partition as explained at the
beginning of this scenario. To define this partition, click thebutton next to Edit
schema that appears. -
Leave the Set file location check box
clear to use the default path for Hive table. -
Select the Set Delimited row format check
box to display the available options of row format. -
Select the Field check box and enter a
semicolon (;) as field separator in the
field that appears. -
Select the Line check box and leave the
default value as line separator.
Configuring tHiveLoad
-
Double-click tHiveLoad to open its
Component view. -
Select the Use an existing connection
check box and from Component list, select
the connection configured in the tHiveConnection component you are using for this Job. -
From the Load action field, select
LOAD to write data from the file
holding the sample data that is presented at the beginning of this
scenario. -
In the File path field, enter the
directory where the sample data is stored. In this example, the data is
stored in the HDFS system to be used. In the real-world practice, you can
use tHDFSOutput to write data into the HDFS
system and you need to ensure that the Hive application has the appropriate
rights and permissions to read or even move the data.For further information about tHDFSOutput, see tHDFSOutput; for further
information about the related rights and permissions, see the documentation
or contact the administrator of the Hadoop cluster to be used.Note if you need to read data from a local file system other than the HDFS
system, ensure that the data to be read is stored in the local file system
of the machine in which the Job is run and then select the Local check box in this Basic settings view. For example, when the connection mode
to Hive is Standalone, the Job is run in
the machine where the Hive application is installed and thus the data should
be stored in that machine. -
In the Table name field, enter the name
of the target table you need to load data in. In this scenario, it is
employees. -
From the Action on file list, select
APPEND. -
Select the Set partitions check box and
in the field that appears, enter the partition you need to add data to. In
this scenario, this partition is country=’US’.
Then you can press F6 to run this Job.
Once done, the Run view is opened automatically,
where you can check the execution process.
You can as well verify the results in the web console of the Hadoop distribution
used.

If you need to obtain more details about the Job, it is recommended to use the web
console of the Jobtracker provided by the Hadoop distribution you are using.