- Command to import table into hive and give error if table already exists
sqoop import --connect jdbc:mysql://ms.itversity.com:3306/retail_db --username retail_user --password itversity --table orders --hive-import --hive-database training_sqoop_retail --create-hive-table
- To validate files in directory
hadoop fs -Is /user/training/orders
- Command to remove files in directory
hadoop fs -rm -R /user/training/orders
- Command to import data into hive
sqoop import --connect jdbc:mysql://ms.itversity.com:3306/retail_db --username retail_user --password itversity --table orders --hive-import --hive-database training_sqoop_retail --hive-overwrite