hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-21272) information_schema.tables should also contain views
Date Wed, 06 Mar 2019 05:48:03 GMT

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

Daniel Dai commented on HIVE-21272:
-----------------------------------

Checked the code, actually INFORMATION_SCHEMA.TABLES does contain views if the authorizer
is Ranger. The problem here is with StorageBasedAuthorizer, which the permission is decided
by the permission of hdfs files of the tables/views. However, view is a special table which
does not have corresponding hdfs location, so Hive cannot decide the permission of the table.
To be safe, we just make view not available. Since the major use case for information schema
is for Ranger authorizer, in that case, INFORMATION_SCHEMA.TABLES works as expected.

> information_schema.tables should also contain views
> ---------------------------------------------------
>
>                 Key: HIVE-21272
>                 URL: https://issues.apache.org/jira/browse/HIVE-21272
>             Project: Hive
>          Issue Type: Bug
>          Components: Database/Schema
>    Affects Versions: 3.1.0
>            Reporter: Greg Rahn
>            Assignee: Daniel Dai
>            Priority: Critical
>
> Currently it appears that INFORMATION_SCHEMA.TABLES does not contain views.
> Per the ISO SQL standard, 
> {quote}
> The INFORMATION_SCHEMA.TABLES table contains one row for each table {color:red}including
views.{color}
> {quote}
> Example from Postgres:
> {noformat}
> create table t (i int);
> create view v as select i from t;
> select
>   table_catalog,
>   table_schema,
>   table_name,
>   table_type
> from information_schema.tables
> where table_name in ('t','v');
>  table_catalog | table_schema | table_name | table_type
> ---------------+--------------+------------+------------
>  grahn         | public       | t          | BASE TABLE
>  grahn         | public       | v          | VIEW
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message