Day: March 16, 2023

223.Creating Sqoop Job

To display information and usage instructions related to job command sqoop help job Command to create a job sqoop job –create import_orders — import –connect jdbc:mysql://ms.itversity.com:3306/retail_db –username retail_user –password-file file:///home/training/password_file –table orders –warehouse-dir /user/training/sqoop_import/retail_db –delete-target-dir Command to list the jobs already created sqoop job –list Command to get details related to the job sqoop job …

223.Creating Sqoop Job Read More »

222.Adding Password File

Command to create a password file nano password_file echo -n “itversity” > password_file Command to evaluate data using password file sqoop eval –connect jdbc:mysql://ms.itversity.com:3306/retail_db –username retail_user –password-file file:///home/training/password_file -e “SELECT count(1) FROM orders”

216.Sqoop Export – Using update-mode – update-only (default)

Command to launch hive connecting to the specified database hive –database training_sqoop_retail Command to get meta-data on table DESCRIBE FORMATTED daily_revenue; Command to export  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 –update-key order_date Command to connect to mysql mysql -u retail_user -h ms.itversity.com -p To validate table SELECT * FROM …

216.Sqoop Export – Using update-mode – update-only (default) Read More »

215.Sqoop Export – Quick Overview of MySQL for Upsert

Command to connect to mysql mysql -u retail_user -h ms.itversity.com -p Command to connect to a database USE retail_export; Command to get meta-data on table DESCRIBE training_daily_revenue; Command to truncate the table TRUNCATE TABLE training_daily_revenue; Command to insert single record into table INSERT INTO training_daily_revenue VALUES (‘2013-07-25 00:00:00.0’,12500.0) ; INSERT INTO training_daily_revenue VALUES (‘2013-07-26 00:00:00.0’,15000.0) …

215.Sqoop Export – Quick Overview of MySQL for Upsert Read More »