hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yongzhi Chen (JIRA)" <>
Subject [jira] [Updated] (HIVE-16660) Not able to add partition for views in hive when sentry is enabled
Date Fri, 12 May 2017 14:18:04 GMT


Yongzhi Chen updated HIVE-16660:
    Attachment: HIVE-16660.1.patch

The error is because hive fail to compile internal query generated for the alter operation:
SELECT * FROM `default.test_view` WHERE (`p` = '2'); caused NPE when
sentry enabled:
HiveServer2-Handler-Pool: Thread-68]: FAILED: NullPointerException null
	at org.apache.sentry.provider.common.HadoopGroupMappingService.getGroups(
	at org.apache.sentry.binding.hive.authz.HiveAuthzBinding.getGroups(
	at org.apache.sentry.binding.hive.HiveAuthzBindingHook.postAnalyze(
	at org.apache.hadoop.hive.ql.Driver.compile(
	at org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzeAlterTableAddParts(
	at org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzeInternal(
	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(
	at org.apache.hadoop.hive.ql.Driver.compile(
	at org.apache.hadoop.hive.ql.Driver.compile(
	at org.apache.hadoop.hive.ql.Driver.compileInternal(
	at org.apache.hadoop.hive.ql.Driver.compileAndRespond(
	at org.apache.hive.service.cli.operation.SQLOperation.prepare(
	at org.apache.hive.service.cli.operation.SQLOperation.runInternal(
	at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(
	at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementAsync(
	at org.apache.hive.service.cli.CLIService.executeStatementAsync(
	at org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(
	at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(
	at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(
	at org.apache.thrift.ProcessFunction.process(
	at org.apache.thrift.TBaseProcessor.process(
	at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor.process(
	at org.apache.thrift.server.TThreadPoolServer$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$
The NPE is because of null userName for the newly created Driver object for the query.
The patch fix the issue by adding username information. Also fix the NPE when some user applicate
call get partition path information from a view. The NPE like:
Caused by: java.lang.NullPointerException
	at org.apache.hadoop.hive.ql.metadata.Partition.getDataLocation(
	at org.apache.hadoop.hive.ql.metadata.Partition.getPartitionPath(
	at org.apache.hadoop.hive.ql.Driver.execute(
	at org.apache.hadoop.hive.ql.Driver.runInternal(
	at org.apache.hive.service.cli.operation.SQLOperation.runQuery(
	... 11 more

> Not able to add partition for views in hive when sentry is enabled
> ------------------------------------------------------------------
>                 Key: HIVE-16660
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Parser
>            Reporter: Yongzhi Chen
>            Assignee: Yongzhi Chen
>         Attachments: HIVE-16660.1.patch
> Repro:
> create table tesnit (a int) partitioned by (p int);
> insert into table tesnit partition (p = 1) values (1);
> insert into table tesnit partition (p = 2) values (1);
> create view test_view partitioned on (p) as select * from tesnit where p =1;
> alter view test_view add partition (p = 2);
> Error: Error while compiling statement: FAILED: SemanticException [Error 10056]: The
query does not reference any valid partition. To run this query, set hive.mapred.mode=nonstrict

This message was sent by Atlassian JIRA

View raw message