Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-783

Suggestion: SHOW CREATE VIEW to complement SHOW CREATE TABLE

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Impala 1.2.3
    • Impala 2.5.0
    • Frontend

    Description

      If you loop through all the output lines from SHOW TABLES and do a SHOW CREATE TABLE on each one, you end up with errors like so for any views:

      ERROR: AnalysisException: SHOW CREATE TABLE not supported on VIEW: sandbox.maritime_provinces
      Could not execute command: show create table `sandbox`.`maritime_provinces`

      MySQL has a SHOW CREATE VIEW command to go along with SHOW CREATE TABLES:

      https://dev.mysql.com/doc/refman/5.6/en/show-create-view.html

      That seems like a logical complement for Impala too, to avoid having to go do an entirely different road (do DESCRIBE FORMATTED, parse out the view creation text).

      That still leaves the question of how one would know ahead of time when to do SHOW CREATE TABLE vs. SHOW CREATE VIEW, since there is no SHOW VIEWS statement, and SHOW TABLES prints both tables and views with no indication of which is which. MySQL has a variation SHOW FULL TABLES which gives more verbose output, identifying which items are tables and which are views:

      https://dev.mysql.com/doc/refman/5.6/en/show-tables.html

      Let's consider this FULL keyword or some equivalent syntax for Impala too. (Also OK would be some modifier for SHOW TABLES to cause it to list only tables, or only views, or both at the same time.)

      Attachments

        Activity

          People

            tarmstrong Tim Armstrong
            jrussell John Russell
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: