Search code examples
sqlhivehiveql

How to get/generate the create statement for an existing hive table?


Assuming you have "table" already in Hive, is there a quick way like other databases to be able to get the "CREATE" statement for that table?


Solution

  • As of Hive 0.10 this patch-967 implements SHOW CREATE TABLE which "shows the CREATE TABLE statement that creates a given table, or the CREATE VIEW statement that creates a given view."

    Usage:

    SHOW CREATE TABLE myTable;