- 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 10"
- To get list of tables using eval
sqoop eval --connect jdbc:mysql://ms.itversity.com/retail_db --username retail_user --password itversity -e "SHOW tables"
- To get details of a table in database using eval
sqoop eval --connect jdbc:mysql://ms.itversity.com/retail_db --username retail_user --password itversity -e "DESCRIBE orders"
Durga Gadiraju
167. Run Queries in MySQL using “sqoop eval”
- March 16, 2023
- , 6:12 am
- , Uncategorized