168.Understanding Logs in Sqoop
Logs will be generated in the CLI as we run a query in the CLI, As shown in the image.
Logs will be generated in the CLI as we run a query in the CLI, As shown in the image.
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 …
To get information on commands available with respect to list-tables command sqoop help list-tables Command to get list of tables in a database sqoop list-tables –connect jdbc:sqlserver://hostname:port/database_name –username your_username –p Example: sqoop list-tables –connect jdbc:mysql://ms.itversity.com:3306/retail_db –username retail_user -p -P in the above command will prompt for the password.
To get references with respect to list-databases command Sqoop help list-databases Command to get the list of databases sqoop list-databases –connect jdbc:sqlserver://hostname –username your_username –password your_password Example: sqoop list-databases –connect jdbc:mysql ://ms.itversity.com –username retail_user –password itversity
To get information on all high level sqoop commands available for usage sqoop help To get the version of the sqoop installed. sqoop version To get information on a particular command use sqoop help COMMAND Example: sqoop help eval
Sqoop uses the corresponding JDBC Jar file to connect to a respective remote database. To connect to MySql, Sqoop refers for JDBC Jar file in location: /usr/hdp/2.6.5.0-292/sqoop/Iib/mysqI-connector-java.jar Command to check for JDBC jar file ls -ltr /usr/hdp/2.6.5.0-292/sqoop/Iib/mysqI-connector-java.jar