- Command to check if the directory path exists:
hadoop fs -ls /user/training/sqoop_import
- Command to create the directory if it doesn’t exist:
hadoop fs -mkdir /user/training/sqoop_import
- Command to import orders table:
sqoop import --connect jdbc:mysql://ms.itversity.com:3306/retail_db --username retail_user --password itversity --table orders --target-dir /user/training/sqoop_import/retail_db/orders
- To validate the imported table:
hadoop fs -Is /user/training/sqoop_import/retail_db/orders