Sqoop List Tables – Arguments and Examples

Boost your career with Free Big Data Courses!!

A tool which executes the ‘SHOW TABLES’ query against a particular database. Basically, that we called Sqoop list tables. However, there are much more to know about Sqoop list tables. So this document contains the whole concept of list tables in Sqoop.

Moreover, we will learn the purpose and syntax of Sqoop list tables. Afterward, we will see some of Sqoop list-tables arguments and examples to understand it well.

Introduction to Sqoop List Tables

  • A tool which parses as well as executes the ‘SHOW TABLES’ query against a particular database.
  • Also, it lists out the tables in a database.

Sqoop List Tables Purpose and Syntax

Basically, the main purpose of sqoop-list-tables is list tables present in a database.

Syntax

$ sqoop list-tables (generic-args) (list-tables-args)
$ sqoop-list-tables (generic-args) (list-tables-args)
However, the Sqoop list-tables arguments can be entered in any order with respect to one another but the Hadoop generic arguments must precede any list-tables arguments only.

Arguments in Sqoop List Tables

Table.1  Common arguments

ArgumentDescription
–connect <jdbc-uri>Specify JDBC connect string
–connection-manager <class-name>Specify connection manager class to use
–driver <class-name>Manually specify JDBC driver class to use
–hadoop-mapred-home <dir>Override $HADOOP_MAPRED_HOME
–helpPrint usage instructions
–password-fileSet path for a file containing the authentication password
-PRead password from console
–password <password>Set authentication password
–username <username>Set authentication username
–verbosePrint more information while working
–connection-param-file <filename>Optional properties file that provides connection parameters
–relaxed-isolationSet connection transaction isolation to read uncommitted for the mappers.

Sqoop List Tables Example

Basically, all the list tables available in the “corp” database:
$ sqoop list-tables –connect jdbc:mysql://database.example.com/corp
employees
payroll_checks
job_descriptions
Office_supplies
Although, list tables command with common arguments fetches only “public” schema, in case of postgresql. Basically, we use –schema argument to list tables of the particular schema for custom schema. For Example
$ sqoop list-tables –connect jdbc:postgresql://localhost/corp  –username name -P — –schema payrolldept
employees
Expenses

Conclusion

As a result, we have seen the whole concept of Sqoop list tables. Also, we have learned syntax and purpose of a list- tables in sqoop. Moreover, we have seen its arguments as well as examples to understand. However, if you feel any query please ask in the comment section. Then we will definitely get back to you.     
See also-
Sqoop Eval and Sqoop Codegen
For reference

Did we exceed your expectations?
If Yes, share your valuable feedback on Google

follow dataflair on YouTube

Leave a Reply

Your email address will not be published. Required fields are marked *