Perform Sqoop import of order_items - --warehouse-dir

#1

Let us see how we can specify the HDFS location using –warehouse-dir while performing import.

  • If we specify –warehouse-dir, it will create a sub directory with the name of the table.
  • Data will be copied to that sub-directory.
  • If the sub-directory already exists, it will fail saying directory already exists.

Here is the example to import retail_db.orders to /user/training/sqoop_import/retail_db using warehouse-dir.

sqoop import \
  --connect "jdbc:mysql://ms.itversity.com:3306/retail_db" \
  --username retail_user \
  --password itversity \
  --table order_items \
  --warehouse-dir /user/training/sqoop_import/retail_db
0 Likes