Hello Quanlong Huang, Aman Sinha, Sai Hemanth Gantasala, Michael Smith, Impala
Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/20669
to look at the new patch set (#7).
Change subject: IMPALA-3268: Add support for SHOW VIEWS statement
......................................................................
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. Moreover, the
catalog server has to be started with
'--pull_table_types_and_comments=true' in order for this newly
supported statement to work properly.
Specifically, after this patch, a user will be able to retrieve from
Impala the names of Table's whose getTableType() evaluate to
TImpalaTableType.VIEW that match an optional pattern when the catalog
server is started with '--pull_table_types_and_comments=true' which
allows the catalog server to additionally load the table type of each
Table from Hive MetaStore during startup.
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
---
M be/src/service/client-request-state.cc
M be/src/service/frontend.cc
M be/src/service/frontend.h
M common/thrift/CatalogObjects.thrift
M common/thrift/CatalogService.thrift
M common/thrift/Frontend.thrift
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java
A fe/src/main/java/org/apache/impala/analysis/ShowTablesOrViewsStmt.java
M fe/src/main/java/org/apache/impala/analysis/ShowTablesStmt.java
A fe/src/main/java/org/apache/impala/analysis/ShowViewsStmt.java
M fe/src/main/java/org/apache/impala/catalog/Catalog.java
M fe/src/main/java/org/apache/impala/catalog/Db.java
M fe/src/main/java/org/apache/impala/catalog/FeCatalog.java
M fe/src/main/java/org/apache/impala/catalog/FeDb.java
M fe/src/main/java/org/apache/impala/catalog/Hive3MetastoreShimBase.java
M fe/src/main/java/org/apache/impala/catalog/IncompleteTable.java
M fe/src/main/java/org/apache/impala/catalog/Table.java
M fe/src/main/java/org/apache/impala/catalog/local/LocalCatalog.java
M fe/src/main/java/org/apache/impala/catalog/local/LocalDb.java
M fe/src/main/java/org/apache/impala/service/Frontend.java
M fe/src/main/java/org/apache/impala/service/JniFrontend.java
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java
M fe/src/test/java/org/apache/impala/authorization/AuthorizationStmtTest.java
A testdata/workloads/functional-query/queries/QueryTest/show_views.test
M tests/custom_cluster/test_preload_table_types.py
A tests/custom_cluster/test_show_views_statements.py
29 files changed, 612 insertions(+), 118 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/69/20669/7
--
To view, visit http://gerrit.cloudera.org:8080/20669
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I321fc5350392a815949a4e7d2a64d60466689788
Gerrit-Change-Number: 20669
Gerrit-PatchSet: 7
Gerrit-Owner: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Sai Hemanth Gantasala <[email protected]>