You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Xiaomeng Huang (JIRA)" <ji...@apache.org> on 2014/08/20 09:38:26 UTC
[jira] [Commented] (HIVE-7730) Extend ReadEntity to add accessed
columns from query
[ https://issues.apache.org/jira/browse/HIVE-7730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14103568#comment-14103568 ]
Xiaomeng Huang commented on HIVE-7730:
--------------------------------------
Hi [~ashutoshc]
Currently Hive has a new interface for external authorization plugin and semantic hook may be replaced in the future. So I will try to put accessed columns to ReadEntity instread of enhancing semantic hook.This way will be available to hooks as well as authorization interfaces. I have updated the description, and wait for you feedback. Thanks!
> Extend ReadEntity to add accessed columns from query
> ----------------------------------------------------
>
> Key: HIVE-7730
> URL: https://issues.apache.org/jira/browse/HIVE-7730
> Project: Hive
> Issue Type: Bug
> Reporter: Xiaomeng Huang
> Attachments: HIVE-7730.001.patch
>
>
> -Now what we get from HiveSemanticAnalyzerHookContextImpl is limited. If we have hook of HiveSemanticAnalyzerHook, we may want to get more things from hookContext. (e.g. the needed colums from query).-
> -So we should get instance of HiveSemanticAnalyzerHookContext from configuration, extends HiveSemanticAnalyzerHookContext with a new implementation, overide the HiveSemanticAnalyzerHookContext.update() and put what you want to the class.-
> Hive should store accessed columns map or ColumnAccessInfo to ReadEntity when we set HIVE_STATS_COLLECT_SCANCOLS is true.
> Then we can get accessed columns when do authorization in compile before execute.
> Here is the quick implement in SemanticAnalyzer.analyzeInternal() below:
> {code} boolean isColumnInfoNeedForAuth = SessionState.get().isAuthorizationModeV2()
> && HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED);
> if (isColumnInfoNeedForAuth
> || HiveConf.getBoolVar(this.conf, HiveConf.ConfVars.HIVE_STATS_COLLECT_SCANCOLS) == true) {
> ColumnAccessAnalyzer columnAccessAnalyzer = new ColumnAccessAnalyzer(pCtx);
> setColumnAccessInfo(columnAccessAnalyzer.analyzeColumnAccess());
> // TODO: we can put accessed column map to ReadEntity getting from columnAccessInfo
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)