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

Rolando picture Rolando · Aug 8, 2013 · Viewed 154k times · Source

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?

Answer

Lukas Vermeer picture Lukas Vermeer · Aug 9, 2013

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;