Get The Tables List In an external File – Hive

This blog will show you how to retrieve the names of all the tables in the selected database into an external file.

To get a list of the tables without login into the Hive shell, use the following command.

hive -e “USE default; SHOW TABLES;” > AllTables.txt

GetAllTablesFromDBShowAllTablesInTxtFiles

Please keep in mind that if you are practicing with ClouderaVM, the aforementioned file will be generated under /home/cloudera, NOT IN /user/cloudera.

Hope you find this article helpful.

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s