You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/07/28 13:33:48 UTC

[GitHub] [incubator-druid] sashidhar edited a comment on issue #6433: SQL: Bizarre error when computing min(string)

sashidhar edited a comment on issue #6433: SQL: Bizarre error when computing min(string)
URL: https://github.com/apache/incubator-druid/issues/6433#issuecomment-515763342
 
 
   This is still the case.  Adding a unit test in **CalciteQueryTest** (for testing) with query
   ` SELECT min('foo') FROM druid.foo` 
   results in the following:
   
   ```
   java.lang.RuntimeException: Error while applying rule DruidQueryRule(AGGREGATE), args [rel#20:LogicalAggregate.NONE.[](input=rel#19:Subset#2.NONE.[],group={},EXPR$0=MIN($0)), rel#26:DruidQueryRel.NONE.[](query={"queryType":"scan","dataSource":{"type":"table","name":"foo"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[{"type":"expression","name":"v0","expression":"'foo'","outputType":"STRING"}],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"order":"none","filter":null,"columns":["v0"],"legacy":false,"context":{"defaultTimeout":300000,"maxScatterGatherBytes":9223372036854775807,"sqlCurrentTimestamp":"2000-01-01T00:00:00Z","sqlQueryId":"dummy","vectorize":"false"},"descending":false,"granularity":{"type":"all"}},signature={v0:STRING})]
   
   	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:236)
   	at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:646)
   	at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:339)
   	at org.apache.calcite.tools.Programs$SequenceProgram.run(Programs.java:358)
   	at org.apache.calcite.prepare.PlannerImpl.transform(PlannerImpl.java:337)
   	at org.apache.druid.sql.calcite.planner.DruidPlanner.planWithDruidConvention(DruidPlanner.java:119)
   	at org.apache.druid.sql.calcite.planner.DruidPlanner.plan(DruidPlanner.java:89)
   	at org.apache.druid.sql.SqlLifecycle.plan(SqlLifecycle.java:141)
   	at org.apache.druid.sql.SqlLifecycle.planAndAuthorize(SqlLifecycle.java:207)
   	at org.apache.druid.sql.SqlLifecycle.runSimple(SqlLifecycle.java:244)
   	at org.apache.druid.sql.calcite.BaseCalciteQueryTest.getResults(BaseCalciteQueryTest.java:619)
   	at org.apache.druid.sql.calcite.BaseCalciteQueryTest.getResults(BaseCalciteQueryTest.java:566)
   	at org.apache.druid.sql.calcite.BaseCalciteQueryTest.testQuery(BaseCalciteQueryTest.java:554)
   	at org.apache.druid.sql.calcite.BaseCalciteQueryTest.testQuery(BaseCalciteQueryTest.java:464)
   	at org.apache.druid.sql.calcite.CalciteQueryTest.testMin(CalciteQueryTest.java:5513)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
   	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
   	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
   	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
   	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
   	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
   	at org.apache.druid.sql.calcite.util.QueryLogHook$1.evaluate(QueryLogHook.java:95)
   	at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
   	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
   	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
   	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
   	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
   	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
   	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
   	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
   	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
   	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
   	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
   	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
   	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
   	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
   	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
   	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
   	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
   	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
   	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
   Caused by: org.apache.druid.java.util.common.ISE: Cannot create aggregator factory for type[STRING]
   	at org.apache.druid.sql.calcite.aggregation.builtin.MinSqlAggregator.createMinAggregatorFactory(MinSqlAggregator.java:72)
   	at org.apache.druid.sql.calcite.aggregation.builtin.MinSqlAggregator.getAggregation(MinSqlAggregator.java:53)
   	at org.apache.druid.sql.calcite.aggregation.builtin.SimpleSqlAggregator.toDruidAggregation(SimpleSqlAggregator.java:86)
   	at org.apache.druid.sql.calcite.rule.GroupByRules.translateAggregateCall(GroupByRules.java:131)
   	at org.apache.druid.sql.calcite.rel.DruidQuery.computeAggregations(DruidQuery.java:435)
   	at org.apache.druid.sql.calcite.rel.DruidQuery.computeGrouping(DruidQuery.java:285)
   	at org.apache.druid.sql.calcite.rel.DruidQuery.<init>(DruidQuery.java:167)
   	at org.apache.druid.sql.calcite.rel.PartialDruidQuery.build(PartialDruidQuery.java:306)
   	at org.apache.druid.sql.calcite.rel.DruidQueryRel.toDruidQuery(DruidQueryRel.java:97)
   	at org.apache.druid.sql.calcite.rel.DruidQueryRel.toDruidQueryForExplaining(DruidQueryRel.java:109)
   	at org.apache.druid.sql.calcite.rel.DruidRel.isValidDruidQuery(DruidRel.java:62)
   	at org.apache.druid.sql.calcite.rule.DruidRules$DruidQueryRule.onMatch(DruidRules.java:132)
   	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:212)
   	... 44 more
   ```
   What is expected here to handle this ?

----------------------------------------------------------------
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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org