Professional Documents
Culture Documents
• It can import all tables, a single table, or a portion of a table into HDFS.
● We can tell the query to be executed once and imported serially by specifying
a single map task with -m 1
$ sqoop import \
--query ‘SELECT a.*, b.* FROM a JOIN b ON (a.id == b.id) WHERE $CONDITIONS’\
-m 1
-- target-dir /user/foo/joinresults
$ sqoop import \
--connect jdbc:mysql://mysql.example.com/sqoop \
--username sqoop --password sqoop \
--query ‘SELECT normcities.id, countries.country, normcities.city FROM
normcities \
JOIN countries USING(country_id) WHERE $CONDITIONS’ \
--split-by id
--target-dir cities
Importing With Free-Form Query
#
# Options file for Sqoop import
#
#
# Remaining options should be specified in the command line.
#
Arguments
Import control arguments
Supports --direct option for MySql and PostgreSQL to increase importing speed
Incremental Imports with Sqoop
https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html