You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Zihao Ye <yz...@gmail.com> on 2020/02/11 07:28:51 UTC

ColumnAccessInfo to HiveAuthorizer is different for views and tables

Hi Team,

Column authorization for Hive views was introduced in HIVE-13095
<https://issues.apache.org/jira/browse/HIVE-13095>. But it seems that the
behavior is different for views and tables. For example:

1. create table t(key string, value string);
> 2. select value from t where key = 'foo';

3. create view v as select * from t;
> 4. select value from v where key = 'foo';


For query 2, accessed columns are `key` and `value`, which is expected. But
for query 4, only `value` is regarded as an accessed column.

While digging into the codes, I found that tables add the refereced columns
and partitions in TableScanOperator to accessed columns. But views only add
columns in SelectOperator.

I'm wondering why there is a gap between views and tables. Is it a bug or
is it so designed?

Thanks!