Warning
This component will be available in the Palette of
Talend Studio on the condition that you have subscribed to one of
the Talend
solutions with Big Data.
Component family |
Big Data / Sqoop |
|||
Function |
tSqoopImport calls Sqoop to NoteSqoop is typically installed in every Hadoop distribution. But if the Hadoop |
|||
Purpose |
tSqoopImport is used to define |
|||
Basic settings |
Mode |
Select the mode in which Sqoop is called in a Job execution. Use Commandline: the Sqoop shell is used to call Sqoop. Use Java API: the Java API is used to call Sqoop. In this |
||
Hadoop properties |
Either Built-in or 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 button to display the dialog box in which you can
|
||
Hadoop Version |
Select the version of the Hadoop distribution you are using. The available options vary
|
|||
Configuration |
NameNode URI |
Select this check box to indicate the location of the NameNode of the Hadoop cluster to be For further information about the Hadoop Map/Reduce framework, see the Map/Reduce tutorial |
||
JobTracker Host |
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 |
|||
Authentication |
Use kerberos authentication |
If you are accessing the Hadoop cluster running with Kerberos security, select this check In addition, since this component performs Map/Reduce computations, you also need to 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 |
|||
Hadoop user name |
Enter the user name under which you want to execute the Job. Since a file or a directory in |
|||
JDBC property |
Either Built-in or Repository:
|
|||
Connection |
Enter the JDBC URL used to connect to the database where the source data is stored. |
|||
|
User name and |
Enter the authentication information used to connect to the source database. To enter the password, click the […] button next to the If your password is stored in a file, select the The password is stored
Note that this feature is available depending on the Sqoop version you are |
||
Driver JAR |
In either the Use Commandline mode or the Java API mode, you must add the driver file of the database to be |
|||
|
Table Name |
Type in the name of the table to be transferred into HDFS. This field is not available when you are using the free-form query |
||
|
File format |
Select a file format for the data to be transferred. By default, the file format is |
||
Delete target directory |
Select this check box to remove the target directory of the |
|||
|
Append |
Select this check box to append transferred data to an existing |
||
|
Compress |
Select this check box to enable compression. |
||
Direct |
Select this check box to use the import fast path. |
|||
Specify columns |
Select this check box to display the column table where you can |
|||
Use WHERE clause |
Select this check box to use a WHERE clause that controls the rows |
|||
Query |
Use query |
Select this check box to use the free-form query mode provided by Once selecting it, you are able to enter the free-form query you Then, you must specify the target directory and if the Sqoop WarningOnce queries are entered here, the value of the argument |
||
|
Specify Target Dir |
Select this check box to enter the path to the target location, in This location should be a new directory; otherwise, you must |
||
Specify Split by |
Select this check box, then, enter the table column you need and For example, for a table where the id column is the key column, enter tablename.id. Then Sqoop will split the |
|||
|
Specify Number of Mappers |
Select this check box to indicate the number of map tasks (parallel processes) used to If you do not want Sqoop to work in parallel, enter 1 |
||
|
Print Log |
Select this check box to activate the Verbose check |
||
|
Verbose |
Select this check box to print more information while working, for example, the debugging |
||
Advanced settings |
Use MySQL default delimiters |
Select this check box to use MySQL’s default delimiter set. This check box is available |
||
Define Java mapping |
Sqoop provides default configuration that maps most SQL types to appropriate Java types. |
|||
Define Hive mapping |
Sqoop provides default configuration that maps most SQL types to appropriate Hive types. |
|||
|
Additional arguments |
Complete this table to use additional arguments if needs be. By adding additional arguments, you are able to perform multiple operations in one single |
||
Connector specific |
Use speed parallel data transfers |
Select this check box to enable quick parallel data transfers between the Teradata
You must ensure that the Hortonworks Connector for Teradata has been Available in the Use Commandline |
||
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
|
|||
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 If the distribution is YARN, then the memory parameters to be set become Map (in Mb), Reduce (in Mb) and |
|||
Path separator in server |
Leave the default value of the Path separator in server as |
|||
|
tStatCatcher Statistics |
Select this check box to collect log data at the component |
||
Global Variables |
ERROR_MESSAGE: the error message generated by the EXIT_CODE: the exit code of the remote command. This is 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 used standalone. It respects the Sqoop prerequisites. You need necessary We recommend using the Sqoop of version 1.4+ in order to benefit the full functions of 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
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 |
If you have selected the Use Commandline mode, you need |
|||
Connections |
Outgoing links (from this component to another):
Trigger: Run if; On Subjob Ok; On Incoming links (from one component to this one): Row: Iterate;
Trigger: Run if; On Subjob Ok; On For further information regarding connections, see Talend Studio User Guide. |
This scenario illustrates how to use tSqoopImport to
import a MySQL table to a given HDFS system.
The sample data to be used in this scenario reads as follows:
1 2 3 4 5 |
id,wage,mod_date 0,2000,2008-06-26 04:25:59 1,2300,2011-06-12 05:29:45 2,2500,2007-01-15 11:59:13 3,3000,2010-05-02 15:34:05 |
The data is stored in a MySQL table called sqoopmerge.
Before starting to replicate this scenario, ensure that you have appropriate rights
and permissions to access the Hadoop distribution to be used. 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 Talend Studio User Guide.
-
Drop tSqoopImport onto the
workspace.
Configuring tSqoopImport
-
Double-click tSqoopImport to open its
Component view. -
In the Mode area, select Use Java API.
-
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 NameNode URI field, enter the
location of the master node, the NameNode, of the distribution to be used.
For example, hdfs://talend-cdh4-namenode:8020. -
In the JobTracker Host field, enter the
location of the JobTracker of your distribution. For example, talend-cdh4-namenode:8021.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/. -
If the distribution to be used requires Kerberos authentication, select
the Use Kerberos authentication check box
and complete the authentication details. Otherwise, leave this check box
clear.If you need to use a Kerberos keytab file to log in, select Use a
keytab to authenticate. A keytab file contains pairs of Kerberos principals
and encrypted keys. You need to enter the principal to be used in the Principal field and the access path to the keytab file itself in the
Keytab field.Note that the user that executes a keytab-enabled Job is not necessarily the one a
principal designates but must have the right to read the keytab file being used. For
example, the user name you are using to execute a Job is user1 and the principal to be used is guest; in this situation, ensure that user1 has the right to read the keytab file to be used. -
In the Connection field, enter the URI of
the MySQL database where the source table is stored. For example, jdbc:mysql://10.42.10.13/mysql. -
In Username and Password, enter the authentication information.
-
Under the Driver JAR table, click the
[+] button to add one row, then in this
row, click the […] button to display the
drop-down list and select the jar file to be used from that list. In this
scenario, it is mysql-connector-java-5.1.30-bin.jar.If the […] button does not appear,
click anywhere in this row to make it displayed. -
In the Table Name field, enter the name
of the source table. In this scenario, it is sqoopmerge. -
From the File format list, select the
format that corresponds to the data to be used, textfile in this scenario. -
Select the Specify target dir check box
and enter the directory where you need to import the data to. For example,
/user/ychen/target_old.
Then you can press F6 to run this Job.
Once done, you can verify the results in the target directory you have specified,
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.