Day: March 16, 2023

171.Perform Sqoop Import of orders – –table and – –target-dir

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

169.Redirecting Sqoop Logs into files

To redirect log messages to other files sqoop eval –connect jdbc:mysql://ms.itversity.com:3306/retail_db –username retail_user –password itversity –query “SELECT * FROM orders LIMIT 10” l>query.out 2>query.err In above command, 1 refers to standard output, Where output will be redirected and saved to file query.out. 2 refers to standard error, Where error message will be redirected and saved …

169.Redirecting Sqoop Logs into files Read More »

167. Run Queries in MySQL using “sqoop eval”

To get information on commands available with respect to eval command sqoop help eval Command to evaluate SQL statements against a database and return the results sqoop eval –connect jdbc:mysql://hostname:port/database_name –username your_username -P –query “SELECT * FROM table_name LIMIT 10;” Example: sqoop eval –connect jdbc:mysql://ms.itversity.com/retail_db –username retail_user –password itversity –query “SELECT * FROM orders LIMIT …

167. Run Queries in MySQL using “sqoop eval” Read More »