tELTHiveMap
Builds graphically the Hive QL statement in order to transform data.
The three ELT Hive components are closely related, in terms of their
operating conditions. These components should be used to handle Hive DB schemas to
generate Insert statements, including clauses, which are to be executed in the DB output
table defined.
This component uses the tables provided as input, to feed the
parameter in the built statement. The statement can include inner or
outer joins to be implemented between tables or between one table
and its aliases.
tELTHiveMap Standard properties
These properties are used to configure tELTHiveMap running in the Standard Job framework.
The Standard
tELTHiveMap component belongs to the ELT family.
The component in this framework is available when you are using one of the Talend solutions with Big Data.
Basic settings
Property type |
Either Built-In or Repository. Built-In: No property data stored centrally.
Repository: Select the repository file where the |
||
Use an existing connection |
Select this check box and in the Component Note:
When a Job contains the parent Job and the child Job, if you need to share an
existing connection between the two levels, for example, to share the connection created by the parent Job with the child Job, you have to:
For an example about how to share a database connection across Job levels, see |
||
ELT Hive Map editor |
The ELT Map editor helps you to define the output schema as |
||
Style link |
Select the way in which links are displayed.
Auto: By default, the links between the
Bezier curve: Links between the schema
Line: Links between the schema and the This option slightly optimizes performance. |
||
Distribution |
Select the cluster you are using from the drop-down list. The options in the
list vary depending on the component you are using. Among these options, the following ones requires specific configuration:
|
||
Hive version |
Select the version of the Hadoop distribution you are using. The available
options vary depending on the component you are using. Along with the evolution of Hadoop, please note the following changes:
|
||
Hive server |
Select the Hive server through which you want the Job using this component to This Hive server list is available only For further information about HiveServer2, see https://cwiki.apache.org/confluence/display/Hive/Setting+Up+HiveServer2. |
||
Connection mode |
Select a connection mode from the list. The options vary |
||
Host |
Database server IP address. |
||
Port |
Listening port number of DB server. |
||
Database |
Name of the database. According to the documentation of Hive, For further information, see https://cwiki.apache.org/confluence/display/Hive/HiveClient. |
||
Username and Password |
DB user authentication data. To enter the password, click the […] button next to the |
||
Use kerberos authentication |
If you are accessing a Hive Metastore running with Kerberos security,
select this check box and then enter the relevant parameters in the fields that appear.
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 |
||
Use a keytab to authenticate |
Select the Use a keytab to authenticate Note that the user that executes a keytab-enabled Job is not necessarily |
||
Use SSL encryption |
Select this check box to enable the SSL or TLS 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:
|
||
Set Resource Manager |
Select this check box and in the displayed field, enter the location of the Then you can continue to set the following parameters depending on the
configuration of the Hadoop cluster to be used (if you leave the check box of a parameter clear, then at runtime, the configuration about this parameter in the Hadoop cluster to be used will be ignored ):
For further information about these parameters, see the documentation or For further information about the Hadoop Map/Reduce framework, see the |
||
Set NameNode URI |
Select this check box and in the displayed field, enter the URI of the Hadoop For further information about the Hadoop Map/Reduce framework, see the |
||
Execution engine |
Select this check box and from the drop-down list, select the framework you need to use to This list is available only when you are using the Embedded mode for the Hive connection and the distribution you are working with
is among the following ones:
Before using Tez, ensure that the Hadoop cluster you are using supports Tez. You will need to configure the access to the relevant Tez libraries via the Advanced settings view of this component. For further information about Hive on Tez, see Apache’s related documentation in https://cwiki.apache.org/confluence/display/Hive/Hive+on+Tez. Some examples are presented there to show how Tez can be used to gain performance over MapReduce. |
When you need to enable Hive components to access HBase:
These parameters are available only when the Use an existing
connection check box is clear.
Store by HBase |
Select this check box to display the parameters to be set to allow the Hive components to
access HBase tables:
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 [+] button to add rows to this table, then, in the Jar name column, select the jar file(s) to be registered and in the |
Advanced settings
Tez lib |
Select how the Tez libraries are accessed:
|
Temporary path |
If you do not want to set the Jobtracker and the NameNode when you execute the |
Hadoop properties |
Talend Studio uses a default configuration for its engine to perform operations in a Hadoop distribution. If you need to use a custom configuration in a specific situation, complete this table with the property or properties to be customized. Then at runtime, the customized property or properties will override those default ones.
For further information about the properties required by Hadoop and its related systems such
as HDFS and Hive, see the documentation of the Hadoop distribution you are using or see Apache’s Hadoop documentation on http://hadoop.apache.org/docs and then select the version of the documentation you want. For demonstration purposes, the links to some properties are listed below:
|
Hive properties |
Talend Studio uses a default configuration for its engine to perform
operations in a Hive database. If you need to use a custom configuration in a specific situation, complete this table with the property or properties to be customized. Then at runtime, the customized property or properties will override those default ones. For further information for Hive dedicated properties, see https://cwiki.apache.org/confluence/display/Hive/AdminManual+Configuration.
|
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 |
tStatCatcher Statistics |
Select this check box to collect log data at the component |
Temporary path |
If you do not want to set the Jobtracker and the NameNode when you execute the |
Global Variables
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 |
Usage
Usage rule |
tELTHiveMap is used along with a If the Studio used to connect to a Hive database is operated on Windows, you Note:
The ELT components do not handle actual data flow but only |
Dynamic settings |
Click the [+] button to add a The Dynamic settings table is For examples on using dynamic parameters, see Scenario: Reading data from databases through context-based dynamic connections and Scenario: Reading data from different MySQL databases using dynamically loaded connection parameters. For more information on Dynamic |
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 |
Scenario: Joining table columns and writing them into Hive
This scenario applies only to a Talend solution with Big Data.
This scenario uses a four-component Job to join the columns selected from two Hive
tables and write them into another Hive table.

Preparing the Hive tables
-
Create the Hive table you want to write data in. In this scenario, this
table is named as agg_result, and you can
create it using the following statement in tHiveRow:
create table agg_result (id int, name string, address string, sum1 string, postal string, state string, capital string, mostpopulouscity string) partitioned by (type string) row format delimited fields terminated by ';' location '/user/ychen/hive/table/agg_result'
In this statement,
‘/user/ychen/hive/table/agg_result’ is the directory used in
this scenario to store this created table in HDFS. You need to replace it
with the directory you want to use in your environment. -
Create two input Hive tables containing the columns you want to join and
aggregate these columns into the output Hive table, agg_result. The statements to be used are:
create table customer (id int, name string, address string, idState int, id2 int, regTime string, registerTime string, sum1 string, sum2 string) row format delimited fields terminated by ';' location '/user/ychen/hive/table/customer'
and
create table state_city (id int, postal string, state string, capital int, mostpopulouscity string) row format delimited fields terminated by ';' location '/user/ychen/hive/table/state_city'
-
Use tHiveRow to load data into the two
input tables, customer and state_city. The statements to be used are:
"LOAD DATA LOCAL INPATH 'C:/tmp/customer.csv' OVERWRITE INTO TABLE customer"
and
"LOAD DATA LOCAL INPATH 'C:/tmp/State_City.csv' OVERWRITE INTO TABLE state_city"
The two files, customer.csv and
State_City.csv, are two local files
we created for this scenario. You need to create your own files to provide
data to the input Hive tables. The data schema of each file should be
identical with their corresponding table.You can use tRowGenerator and tFileOutputDelimited to create these two files
easily. For further information about these two components, see tRowGenerator and tFileOutputDelimited.For further information about the Hive query language, see https://cwiki.apache.org/confluence/display/Hive/LanguageManual.
Linking the components
-
In the
Integration
perspective
of
Talend 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
Talend Studio User Guide. -
Drop two tELTHiveInput components and
tELTHiveMap and tELTHiveOutput onto the workspace. -
Connect them using the Row > Main
link.Each time when you connect two components, a wizard pops up to prompt you
to name the link you are creating. This name must be the same as that of the
Hive table you want the active component to process. In this scenario, the
input tables the two tELTHiveInput
components will handle are customer and
state_city and the output table
tELTHiveOutput will handle is agg_result.
Configuring the input schemas
-
Double-click the tELTHiveInput component
using the customer link to open its
Component view. - Click the […] button next to Edit schema to open the schema editor.
-
Click the
button as many times as required to add columns and
rename them to replicate the schema of the customer table we created earlier in Hive.You can as well use the customer schema you retrieve and store in the Repository to set up this schema. For further
information about how to set up a connection to Hive and retrieve and store the
schema in Repository, see
Talend Studio User Guide. -
In the Default table name field, enter
the name of the input table, customer, to
be processed by this component. -
Double-click the other tELTHiveInput
component using the state_city link to
open its Component view. - Click the […] button next to Edit schema to open the schema editor.
-
Click the
button as many times as required to add columns and
rename them to replicate the schema of the state_city table we created earlier in Hive. -
In the Default table name field, enter
the name of the input table, state_city,
to be processed by this component.
Mapping the input and the output schemas
Configuring the connection to Hive
-
Click tELTHiveMap, then, click Component to open its Component view.
-
In the Version area, select the Hadoop
distribution you are using and the Hive version. -
In the Connection mode list, select the
connection mode you want to use. If your distribution is HortonWorks, this
mode is Embedded only. -
In the Host field and the Port field, enter the authentication information
for the component to connect to Hive. For example, the host is talend-hdp-all and the port is 9083. -
Select the Set Jobtracker URI check box
and enter the location of the Jobtracker. For example, talend-hdp-all:50300. -
Select the Set NameNode URI
check box and enter the location of the NameNode. For example, hdfs://talend-hdp-all:8020. If you are using WebHDFS, the location should be
webhdfs://masternode:portnumber; if this WebHDFS is secured
with SSL, the scheme should be swebhdfs and you need to use
a tLibraryLoad in the Job to load the library required by
the secured WebHDFS.
Mapping the schemas
-
Click ELT Hive Map Editor to map the
schemas -
On the input side (left in the figure), click the Add alias button to add the table to be used.
- In the pop-up window, select the customer table, then click OK.
- Repeat the operations to select the state_city table.
-
Drag and drop the idstate column from
the customer table onto the id column of the state_city table. Thus an inner join is created
automatically. -
On the output side (the right side in the figure), the agg_result table is empty at first. Click
at the bottom of this side to add as many columns as
required and rename them to replicate the schema of the agg_result table you created earlier in Hive.Note:The type column is the partition
column of the agg_result table and
should not be replicated in this schema. For further information about
the partition column of the Hive table, see the Hive manual. -
From the customer table, drop id, name,
address, and sum1 to the corresponding columns in the agg_result table. -
From the state_city table, drop
postal, state, capital and
mostpopulouscity to the corresponding
columns in the agg_result table. -
Click OK to validate these
changes.
Configuring the output schema
-
Double-click tELTHiveOutput to open its
Component view. -
If this component does not have the same schema of the preceding
component, a warning icon appears. In this case, click the Sync columns button to retrieve the schema from
the preceding one and once done, the warning icon disappears. -
In the Default table name field, enter
the output table you want to write data in. In this example, it is agg_result. -
In the Field partition table, click
to add one row. This allows you to write data in the
partition column of the agg_result
table.This partition column was defined the moment we created the agg_result table usingpartitioned by
in the Create statement presented earlier. This
(type string)
partition column is type, which describes
the type of a customer. -
In Partition column, enter type without any quotation marks and in
Partition value, enter prospective in single quotation marks.
Executing the Job
example,
1 |
select * from agg_result; |

This figure present only a part of the table. You can find that the selected input
columns are aggregated and written into the
agg_result table and the partition column is filled with the value
prospective.