Sqoop Tutorial on Sqoop List Tables

this chapter describes how to list out the tables of a particular database in mysql database server using sqoop. sqoop list-tables tool parses and executes the ‘show tables’ query against a particular database. thereafter, it lists out the present tables in a database.

syntax

the following syntax is used for sqoop list-tables command.

$ sqoop list-tables (generic-args) (list-tables-args) 
$ sqoop-list-tables (generic-args) (list-tables-args)

sample query

the following command is used to list all the tables in the userdb database of mysql database server.

$ sqoop list-tables \
--connect jdbc:mysql://localhost/userdb \
--username root

if the command is executes successfully, then it will display the list of tables in the userdb database as follows.

...
13/05/31 16:45:58 info manager.mysqlmanager: preparing to use a mysql streaming resultset.

emp
emp_add
emp_contact