- Command to get list of tables
SHOW tables;
- Command to get meta-data on table
DESCRIBE FORMATTED daily_revenue;
- Command to export table from hive to mysql
sqoop export --connect jdbc:mysql://ms.itversity.com:3306/retail_export --username retail_user --password itversity --export-dir /apps/hive/warehouse/training_sqoop_retail.db/daily_revenue --table training_daily_revenue
- Command to validate table
sqoop eval --connect jdbc:mysql://ms.itversity.com:3306/retail_export --username retail_user --password itversity -e "SELECT * FROM training_daily_revenue LIMIT 10"
sqoop eval --connect jdbc:mysql://ms.itversity.com:3306/retail_export --username retail_user --password itversity -e "SELECT count(1) FROM training_daily_revenue"
- Command to connect to mysql
mysql -u retail_user -h ms.itversity.com -p
- To validate table
SELECT * FROM training_daily_revenue LIMIT 10;
SELECT count(1) FROM training_daily_revenue;
Durga Gadiraju
210.Sqoop Export – Perform Simple Export – –table and –export-dir
- March 16, 2023
- , 12:02 pm
- , Uncategorized