Sqoop - Import
Table of Contents
About
The sqoop import command line (ie the import command of the sqoop cli)
Articles Related
Type
Default
sqoop import \
--connect jdbc:teradata://{host name or ip address}/Database=retail \
--connection-manager org.apache.sqoop.teradata.TeradataConnManager \
--username dbc \
--password dbc \
--table SOURCE_TBL \
--target-dir /user/hive/incremental_table \
-m 1
Incremental
via:
- the parameters:
- check-column,
- incremental
- last-value
- or a query (ie select * from SOURCE_TBL where modified_date > {last_import_date} AND $CONDITIONS)
With parameters:
sqoop import \
--connect jdbc:teradata://{host name or ip address}/Database=retail \
--connection-manager org.apache.sqoop.teradata.TeradataConnManager \
--username dbc \
--password dbc \
--table SOURCE_TBL \
--target-dir /user/hive/incremental_table \
-m 1 \
--check-column modified_date \
--incremental lastmodified
--last-value {last_import_date}
Query
- Incremental update via query
sqoop import \
--connect jdbc:teradata://{host name or ip address}/Database=retail \
--connection-manager org.apache.sqoop.teradata.TeradataConnManager \
--username dbc \
--password dbc \
--table SOURCE_TBL \
--target-dir /user/hive/incremental_table \
-m 1 \
--query 'select * from SOURCE_TBL where modified_date > {last_import_date} AND $CONDITIONS’