Exports
Sqoop Export is also in a similar process, only the source will be HDFS. Export is performed in two steps;
Gather metadata
Submit map-only job
The following figure explains the export into Sqoop:
Sqoop Export has following options:
Exporting files from under the HDFS directory to a table:
sqoop export \ --connect jdbc:mysql://mysql.example.com/sqoop \ --username sqoop \ --password sqoop \ --table cities \ --export-dir cities
Batch inserts export:
sqoop export \ --connect jdbc:mysql://mysql.example.com/sqoop \ --username sqoop \ --password sqoop \ --table cities \ --export-dir cities \ --batch
Updating existing dataset:
sqoop export \ --connect jdbc:mysql://mysql.example.com/sqoop \ --username sqoop \ --password sqoop \ --table cities \ --update-key id
Upsert export:
sqoop export \ --connect jdbc:mysql://mysql.example.com/sqoop \ --username sqoop \ --password sqoop \ --table cities \ --update-key id \ --update-mode allowinsert
Column export:
sqoop export \ --connect jdbc:mysql://mysql.example.com...