[ https://issues.apache.org/jira/browse/HIVE-28280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17882821#comment-17882821 ]
Soumyakanti Das commented on HIVE-28280: ---------------------------------------- [~zabetak] [~kkasa] I wasn't able to reproduce this on [master|https://github.com/apache/hive/commit/e39f67a958f882a6d4e5e2bac165d6b83bc1640f], [4.0.0|https://github.com/apache/hive/commit/183f8cb41d3dbed961ffd27999876468ff06690c], or [9f496bc9ff5aa8ad9f27c71ff9d29bd0720a506d|https://github.com/apache/hive/commit/9f496bc9ff5aa8ad9f27c71ff9d29bd0720a506d] - closest commit to when this Jira was created. However, adding a limit did the trick, similar to the issue described in the linked ticket - HIVE-21163 This is failing in current [master|https://github.com/apache/hive/commit/e39f67a958f882a6d4e5e2bac165d6b83bc1640f]: {code:java} set hive.security.authorization.enabled=true; create table t1 (username string); create view vw_t1 as select distinct username from t1 limit 5; select * from vw_t1; {code} {noformat} [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.749 s <<< FAILURE! - in org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver [ERROR] org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[test] Time elapsed: 2.706 s <<< FAILURE! java.lang.AssertionError: Client execution failed with error code = 40000 runningselect * from vw_t1 fname=test.q org.apache.hadoop.hive.ql.parse.SemanticException: View vw_t1 is corresponding to rel#84:HiveSortLimit.HIVE.[].any(input=HiveProject#83,fetch=5), rather than a HiveProject. at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.genLogicalPlan(CalcitePlanner.java:5036) at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1630) at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1573) at org.apache.calcite.tools.Frameworks.lambda$withPlanner$0(Frameworks.java:131) at org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:914) at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:180) at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:126) at org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1325) at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:573) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:13164) at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:466) at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:332) at org.apache.hadoop.hive.ql.Compiler.analyze(Compiler.java:224) at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:109) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:499) at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:451) at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:415) at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:409) at org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:121) at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:229) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:257){noformat} > SemanticException when querying VIEW with DISTINCT clause > --------------------------------------------------------- > > Key: HIVE-28280 > URL: https://issues.apache.org/jira/browse/HIVE-28280 > Project: Hive > Issue Type: Bug > Components: CBO > Affects Versions: 4.0.0 > Reporter: Stamatis Zampetakis > Assignee: Stamatis Zampetakis > Priority: Major > > Consider the following view "vw_t1" over table "t1". > {code:sql} > create table t1 (username string); > create view vw_t1 as select distinct username from t1; > {code} > When authorization is enabled querying the view fails at compile time with a > SemanticException. > {code:sql} > set hive.security.authorization.enabled=true; > select * from vw_t1; > {code} > The stacktrace is outlined below. > {noformat} > org.apache.hadoop.hive.ql.parse.SemanticException: View vw_t1 is > corresponding to > rel#73:HiveAggregate.HIVE.[].any(input=HiveProject#72,group={0}), rather than > a HiveProject. > at > org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.genLogicalPlan(CalcitePlanner.java:5024) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1629) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1572) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.calcite.tools.Frameworks.lambda$withPlanner$0(Frameworks.java:131) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:914) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:180) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:126) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1324) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:572) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:13178) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:465) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:327) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.Compiler.analyze(Compiler.java:224) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:107) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:519) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:471) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:436) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:430) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:121) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:229) > ~[hive-exec-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT] > at > org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:257) > ~[hive-cli-4.1.0-SNAPSHOT.jar:?] > at > org.apache.hadoop.hive.cli.CliDriver.processCmd1(CliDriver.java:201) > ~[hive-cli-4.1.0-SNAPSHOT.jar:?] > at > org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:127) > ~[hive-cli-4.1.0-SNAPSHOT.jar:?] > at > org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:425) > ~[hive-cli-4.1.0-SNAPSHOT.jar:?] > at > org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:356) > ~[hive-cli-4.1.0-SNAPSHOT.jar:?] > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)