Day: March 17, 2023

220.Sqoop Export – Using Stage Table

To display information and usage instructions related to export command sqoop help export Command to connect to mysql mysql -u retail_user -h ms.itversity.com -p Command to connect to a database USE retail_export; Select statement on table SELECT count(1) FROM training_daily_revenue; Command to view records in table SELECT * FROM training_daily_revenue LIMIT 10; Command to delete …

220.Sqoop Export – Using Stage Table Read More »

219.Sqoop Export – Specifying Delimiters

To display information and usage instructions related to export command sqoop help export Command to launch hive connecting to the specified database hive –database training_sqoop_retail; Command to get list of tables SHOW tables; Command to create table CREATE TABLE daily_revenue01 AS SELECT * FROM daily_revenue; Command to get meta-data on table DESCRIBE FORMATTED daily_revenue01; Command …

219.Sqoop Export – Specifying Delimiters Read More »

218.Sqoop Export – Specifying Columns

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 alter table ALTER TABLE ADD description VARCHAR(200); Command to export data sqoop export –connect jdbc:mysql://ms.itversity.com:3306/retail_export –username retail_user –password …

218.Sqoop Export – Specifying Columns Read More »

217.Sqoop Export – Using update-mode – allow-insert

Command to merge data using update-mode 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 –update-mode allowinsert Command to connect to mysql mysql -u retail_user -h ms.itversity.com -p Command to connect to a database USE retail_export; To validate table SELECT count(1) FROM training_daily_revenue; SELECT * FROM training_daily_revenue WHERE order_date LIKE …

217.Sqoop Export – Using update-mode – allow-insert Read More »