Configuration of tSqoopimport in CommandLine and Java API mode

Talend Version (Required)       6.3.1


Configuration of tSqoopimport in CommandLine and Java API mode to transfer data from a relational DB to HDFS.
Additional Versions Cloudera 5.7, Talend
Product (Required) Talend Data Fabric
Component (Required) tSqoopImport
Problem Description How-to make tSqoopImport work in Commandline and API mode.
Problem root cause N/A
Solution or Workaround

Server side preparation

  1. Add database drivers into the /var/lib/sqoop folder.



  2. Run a script on the Hadoop server side to ensure that sqoop has been installed and is configured properly, and there are no connection problems with the relational database that stores the data you're copying (substitute your own values as appropriate).

    Script to import from Sybase to target HDFS directory

    sqoop import --connect "" --username "name" --password "myPassword" --target-dir /user/cloudera/T3/importDir --table "name" --split-by id --num-mappers 1 --driver com.sybase.jdbc4.jdbc.SybDriver

    Script to import from Mysql to a target HDFS directory

    sqoop import --connect |jdbc:mysql://localhost:3306/test” --username “root” --password “123456” --table “person” --delete-target-dir

    Note: add --append if you want to add data into the target HDFS; if it conflicts, add --delete-target-dir.


Studio side configuration

CommandLine mode

  1. To use CommandLine mode, select it on the tSqoopImport Component tab:



  2. Add --driver and --connection-manager to the Advanced Settings tab:



Java API mode:

  1. To use Java API mode, select it instead of CommandLine mode on the tSqoopImport Component tab, and set the Driver JAR and Class name as shown below:



  2. Add jdbc.driver.class : com.sybase.jdbc4.jdbc.SybDriver in the Additional Arguments field of the tSqoopImport Advanced Settings tab.



  3. If desired, you can add MapReduce parameters to optimize performance in API mode, in the Job Memory Parameters fields.


JIRA ticket number TBD-5314
Version history
Revision #:
9 of 9
Last update:
‎09-29-2018 12:14 AM
Updated by: