Sqoop Job

1. create a sqoop job that import a MySQL table to HDFS

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sqoop job \
  --create sqoop_import_products \
  -- import \
  --connect "jdbc:mysql://quickstart:3306/retail_db" \
  --username retail_dba \
  --password cloudera \
  --table products \
  --target-dir "/cca175/ps27/products/" \
  --fields-terminated-by "|" \
  --lines-terminated-by "\n" \
  -m 5

NOTE:

  1. there is a blank before the import keyword in -- import. --import (no blank before import) will not work!!!