Description
Query against view with child table that has partitions fails with privilege exception even with correct privileges.
Reproduce:
create table jsamp1 (a string) partitioned by (b int); insert into table jsamp1 partition (b=1) values ("hello"); create view jview as select * from jsamp1; create role viewtester; grant all on table jview to role viewtester; grant role viewtester to group testers; Use MR, the select will succeed: set hive.execution.engine=mr; select count(*) from jview; while use spark: set hive.execution.engine=spark; select count(*) from jview; it fails with: Error: Error while compiling statement: FAILED: SemanticException No valid privileges User tester does not have privileges for QUERY The required privileges: Server=server1->Db=default->Table=j1part->action=select; (state=42000,code=40000)