You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/07/24 13:37:00 UTC

[jira] [Work logged] (HIVE-23911) CBO fails when query has distinct in function and having clause

     [ https://issues.apache.org/jira/browse/HIVE-23911?focusedWorklogId=462955&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-462955 ]

ASF GitHub Bot logged work on HIVE-23911:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Jul/20 13:36
            Start Date: 24/Jul/20 13:36
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request #1310:
URL: https://github.com/apache/hive/pull/1310


   Testing done:
   ```
   mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=having_distinct_function.q -pl itests/qtest -Pitests
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 462955)
    Remaining Estimate: 0h
            Time Spent: 10m

> CBO fails when query has distinct in function and having clause
> ---------------------------------------------------------------
>
>                 Key: HIVE-23911
>                 URL: https://issues.apache.org/jira/browse/HIVE-23911
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {code}
> create table t (col0 int, col1 int);
> select col0, count(distinct col1) from t
> group by col0
> having count(distinct col1) > 1;
> {code}
> {code}
> 2020-07-23T06:12:22,403 ERROR [6990c3d4-71c0-4acf-91ab-393d642ed5e9 main] parse.CalcitePlanner: CBO failed, skipping CBO. 
> org.apache.hadoop.hive.ql.optimizer.calcite.CalciteSemanticException: Distinct without an aggregation.
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.internalGenSelectLogicalPlan(CalcitePlanner.java:4855) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.genSelectLogicalPlan(CalcitePlanner.java:4628) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.genLogicalPlan(CalcitePlanner.java:5234) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1855) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1801) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.calcite.tools.Frameworks.lambda$withPlanner$0(Frameworks.java:130) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:915) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:179) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:125) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1562) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:541) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:12467) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:435) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:297) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.Compiler.analyze(Compiler.java:219) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:104) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:173) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:414) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:363) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:357) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:129) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:231) [hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:256) [hive-cli-4.0.0-SNAPSHOT.jar:?]
> 	at org.apache.hadoop.hive.cli.CliDriver.processCmd1(CliDriver.java:201) [hive-cli-4.0.0-SNAPSHOT.jar:?]
> 	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:127) [hive-cli-4.0.0-SNAPSHOT.jar:?]
> 	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:422) [hive-cli-4.0.0-SNAPSHOT.jar:?]
> 	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:353) [hive-cli-4.0.0-SNAPSHOT.jar:?]
> 	at org.apache.hadoop.hive.ql.QTestUtil.executeClientInternal(QTestUtil.java:730) [hive-it-util-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.ql.QTestUtil.executeClient(QTestUtil.java:700) [hive-it-util-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.cli.control.CoreCliDriver.runTest(CoreCliDriver.java:170) [hive-it-util-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.cli.control.CliAdapter.runTest(CliAdapter.java:157) [hive-it-util-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver(TestMiniLlapLocalCliDriver.java:62) [test-classes/:?]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_144]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_144]
> 	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_144]
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) [junit-4.13.jar:4.13]
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.13.jar:4.13]
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) [junit-4.13.jar:4.13]
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.13.jar:4.13]
> 	at org.apache.hadoop.hive.cli.control.CliAdapter$2$1.evaluate(CliAdapter.java:135) [hive-it-util-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) [junit-4.13.jar:4.13]
> 	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) [junit-4.13.jar:4.13]
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) [junit-4.13.jar:4.13]
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:413) [junit-4.13.jar:4.13]
> 	at org.junit.runners.Suite.runChild(Suite.java:128) [junit-4.13.jar:4.13]
> 	at org.junit.runners.Suite.runChild(Suite.java:27) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) [junit-4.13.jar:4.13]
> 	at org.apache.hadoop.hive.cli.control.CliAdapter$1$1.evaluate(CliAdapter.java:95) [hive-it-util-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
> 	at org.junit.rules.RunRules.evaluate(RunRules.java:20) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) [junit-4.13.jar:4.13]
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:413) [junit-4.13.jar:4.13]
> 	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365) [surefire-junit4-3.0.0-M4.jar:3.0.0-M4]
> 	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273) [surefire-junit4-3.0.0-M4.jar:3.0.0-M4]
> 	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) [surefire-junit4-3.0.0-M4.jar:3.0.0-M4]
> 	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159) [surefire-junit4-3.0.0-M4.jar:3.0.0-M4]
> 	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:377) [surefire-booter-3.0.0-M4.jar:3.0.0-M4]
> 	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:138) [surefire-booter-3.0.0-M4.jar:3.0.0-M4]
> 	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:465) [surefire-booter-3.0.0-M4.jar:3.0.0-M4]
> 	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:451) [surefire-booter-3.0.0-M4.jar:3.0.0-M4]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)