The SHOW CREATE VIEW statement in MySQL displays the CREATE VIEW statement used to create the named view. If you want to do the same thing in Apache Hive, you may use a metastore, which in my case is MySQL.
The following query will help.
SELECT t.* FROM hive.TBLS t
JOIN hive.DBS d ON t.DB_ID = d.DB_ID
WHERE TBL_NAME = ‘vwEmpReport’
AND d.NAME=’default’;
Since views are handled as tables, the TBL_NAME column shows both Tables and Views. Instead of “default,” use the appropriate database name. The “default” database was used in this example.
Hope you find this article helpful.
Please subscribe for more interesting updates.