Community Articles
Find and share helpful community-sourced technical articles.
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.
Labels (2)

Below script is used to get all the Hive Databases and underlining tables or views or INDEX_TABLES in a cluster into a csv file. This helps in evaluating total counts for metrics or identifying any tables:

beeline -u 'jdbc:hive2://zookeeper1:2181,zookeeper2:2181,zookeeper3:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2' --outputformat=csv2 -f table.hql > tableslist.csv 

In table.hql

!tables

Hope this helps you.

4,102 Views
Comments
Explorer

The script in the blog scans through all the databases on the Hive system, and routes all 'Create' Table statements to a file.. https://tips-to-code.blogspot.com/2018/07/automated-bash-script-to-export-all.html

Don't have an account?
Version history
Last update:
‎06-12-2017 09:35 PM
Updated by:
Contributors
Top Kudoed Authors