Reputation: 11587
How to display the view definition of a hive view in its SQL form. Most relational databases supports commands like
SHOW CREATE VIEW viewname;
Upvotes: 30
Views: 86096
Reputation: 591
It is DESCRIBE [EXTENDED|FORMATTED] also. show create table doesn't give enough information sometimes, but DESCRIBE always does;
For a view, DESCRIBE EXTENDED or FORMATTED can be used to retrieve the view's definition. Two relevant attributes are provided: both the original view definition as specified by the user, and an expanded definition used internally by Hive.
Upvotes: 6
Reputation: 420
Yeah, You can use SHOW CREATE TABLE to display the CREATE VIEW statement that created a view.
Link for reference: Hive CREATE VIEW
Upvotes: 2
Reputation: 164
SHOW CREATE table ;
Even thought its a view's definition that you'd like to get, the 'table' keyword has to be mentioned.
Upvotes: 2