Imports
Sqoop import is executed in two steps:
Gather metadata
Submit map only job
The following figure explains the import in to Sqoop:
Sqoop import provides the following options:
Import an entire table:
sqoop import \ --connect jdbc:mysql://mysql.example.com/sqoop \ --username sqoop \ --password sqoop \ --table cities
Import a subset of data:
sqoop import \ --connect jdbc:mysql://mysql.example.com/sqoop \ --username sqoop \ --password sqoop \ --table cities \ --where "country = 'USA'"
Change file format, by default the data will be saved in tab separated csv format but Sqoop provides option for saving the data in Hadoop SequenceFile, Avro binary format and Parquet file:
sqoop import \ --connect jdbc:mysql://mysql.example.com/sqoop \ --username sqoop \ --password sqoop \ --table cities \ --as-sequencefile sqoop import \ --connect jdbc:mysql://mysql.example.com/sqoop \ --username sqoop \ --password sqoop \ --table cities \ --as-avrodatafile
Compressing imported data:
sqoop import \ --connect jdbc...