[ 
https://issues.apache.org/jira/browse/IMPALA-3268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17793870#comment-17793870
 ] 

ASF subversion and git services commented on IMPALA-3268:
---------------------------------------------------------

Commit 7a99449a540bd6bd24cce3ddf2f95b255be29606 in impala's branch 
refs/heads/master from Fang-Yu Rao
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=7a99449a5 ]

IMPALA-3268: Add support for SHOW VIEWS statement

This patch adds the support for the SHOW VIEWS statement and does not
change the current behavior of the SHOW TABLES statement. It is
recommended that we start the catalog server with
'--pull_table_types_and_comments=true' when executing this command
so that the table type of every Table is always available.

Specifically, after this patch, a user will be able to retrieve from
Impala the names of the Table's whose getTableType() evaluate to
TImpalaTableType.VIEW that match an optional pattern.

Similar to the SHOW TABLES statement, the following are supported
after this patch.
1. SHOW VIEWS.
2. SHOW VIEWS "<P1>|<P2>|<P3>", where <PN> denotes the N-th pattern,
   "|" denotes choice and each pattern may contain wildcards denoted by
   "*".
3. SHOW VIEWS IN <db>, where <db> denotes the name of a database.
Refer to the added end-to-end test cases for further details.

Recall that Hive distinguishes materialized views from views. To align
Impala's behavior with that of Hive with respect to the SHOW VIEWS
statement, in this patch we introduce
TImpalaTableType.MATERIALIZED_VIEW as a table type that corresponds to
the table type of 'MATERIALIZED_VIEW' for a
org.apache.hadoop.hive.metastore.api.Table. Due to this we have to
revise the mappings from Hive's table types to Impala's table types in
various places and have to slightly modify the logic used to
instantiate a table with an appropriate type.

Testing:
 - Added various frontend and end-to-end tests to verify the behavior
   of the SHOW VIEWS statement.

Change-Id: I321fc5350392a815949a4e7d2a64d60466689788
Reviewed-on: http://gerrit.cloudera.org:8080/20669
Reviewed-by: Quanlong Huang <[email protected]>
Tested-by: Michael Smith <[email protected]>


> Add command "SHOW VIEWS"
> ------------------------
>
>                 Key: IMPALA-3268
>                 URL: https://issues.apache.org/jira/browse/IMPALA-3268
>             Project: IMPALA
>          Issue Type: New Feature
>          Components: Catalog
>    Affects Versions: Impala 2.2.4, Impala 2.3.0, Impala 2.5.0
>            Reporter: Eric Lin
>            Assignee: Fang-Yu Rao
>            Priority: Minor
>              Labels: usability
>
> Currently to get a list of views, user has to:
>  - SHOW TABLES
>  - scan through the output list
>  - SHOW CREATE TABLE view_name to confirm view_name is a view
> which is tedious.
> So I would like to request the following:
>  - -SHOW TABLES should only return tables-
>  - SHOW VIEWS should only return views
>  - -add a flag to either above commands to return all tables and views-
> This will help lots of end users.
> Edit: Moved the first item and the third item out of the scope of this JIRA 
> to IMPALA-12574 since more discussion may be required.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to