Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL planning error for nested queries #6211

Closed
jihoonson opened this issue Aug 22, 2018 · 4 comments
Closed

SQL planning error for nested queries #6211

jihoonson opened this issue Aug 22, 2018 · 4 comments

Comments

@jihoonson
Copy link
Contributor

The below query works in 0.10, but not in 0.12.2.

SQL

select
  l_linenumber,
  l_linestatus,
  sum(l_quantity) as quantity
from
  lineitem
where
  true and l_linenumber IN (
    select
      l_linenumber
    from
      lineitem
    group by
      l_linenumber
    order by sum(l_quantity) desc limit 100
  )
group by
  l_linenumber,
  l_linestatus
having sum(l_quantity) > 0

Error

2018-08-22T17:38:30,597 WARN [qtp1403539444-112] io.druid.sql.http.SqlResource - Failed to handle query: SqlQuery{query='select l_linenumber, l_linestatus,  sum(l_quantity) as quantity from lineitem where true and l_linenumber IN (   select  l_linenumber  from    lineitem group by  l_linenumber  order by sum(l_quantity) desc limit 100 ) group by l_linenumber, l_linestatus having sum(l_quantity) > 0 ', resultFormat=OBJECT, context={}}
org.apache.calcite.plan.RelOptPlanner$CannotPlanException: Node [rel#76:Subset#9.DRUID.[]] could not be implemented; planner state:

Root: rel#76:Subset#9.DRUID.[]
Original rel:
LogicalFilter(subset=[rel#76:Subset#9.DRUID.[]], condition=[>($2, 0)]): rowcount = 7.5, cumulative cost = {7.5 rows, 15.0 cpu, 0.0 io}, id = 74
  LogicalAggregate(subset=[rel#73:Subset#8.NONE.[]], group=[{0, 1}], quantity=[SUM($2)]): rowcount = 15.0, cumulative cost = {17.062500715255737 rows, 0.0 cpu, 0.0 io}, id = 72
    LogicalProject(subset=[rel#71:Subset#7.NONE.[]], l_linenumber=[$0], l_linestatus=[$1], l_quantity=[$2]): rowcount = 150.0, cumulative cost = {150.0 rows, 450.0 cpu, 0.0 io}, id = 70
      LogicalJoin(subset=[rel#69:Subset#6.NONE.[]], condition=[=($0, $3)], joinType=[inner]): rowcount = 150.0, cumulative cost = {150.0 rows, 0.0 cpu, 0.0 io}, id = 68
        LogicalProject(subset=[rel#59:Subset#1.NONE.[]], l_linenumber=[$6], l_linestatus=[$7], l_quantity=[$10]): rowcount = 100.0, cumulative cost = {100.0 rows, 300.0 cpu, 0.0 io}, id = 58
          LogicalTableScan(subset=[rel#57:Subset#0.NONE.[]], table=[[druid, lineitem]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 11
        LogicalProject(subset=[rel#67:Subset#5.NONE.[]], l_linenumber=[$0]): rowcount = 10.0, cumulative cost = {10.0 rows, 10.0 cpu, 0.0 io}, id = 66
          LogicalSort(subset=[rel#65:Subset#4.NONE.[1 DESC]], sort0=[$1], dir0=[DESC], fetch=[100]): rowcount = 10.0, cumulative cost = {10.0 rows, 184.2068074395237 cpu, 0.0 io}, id = 64
            LogicalAggregate(subset=[rel#63:Subset#3.NONE.[]], group=[{0}], agg#0=[SUM($1)]): rowcount = 10.0, cumulative cost = {11.375000476837158 rows, 0.0 cpu, 0.0 io}, id = 62
              LogicalProject(subset=[rel#61:Subset#2.NONE.[]], l_linenumber=[$6], l_quantity=[$10]): rowcount = 100.0, cumulative cost = {100.0 rows, 200.0 cpu, 0.0 io}, id = 60
                LogicalTableScan(subset=[rel#57:Subset#0.NONE.[]], table=[[druid, lineitem]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 11

Sets:
Set#0, type: RecordType(TIMESTAMP(0) __time, BIGINT count, VARCHAR l_comment, VARCHAR l_commitdate, DOUBLE l_discount, DOUBLE l_extendedprice, VARCHAR l_linenumber, VARCHAR l_linestatus, VARCHAR l_orderkey, VARCHAR l_partkey, BIGINT l_quantity, VARCHAR l_receiptdate, VARCHAR l_returnflag, VARCHAR l_shipdate, VARCHAR l_shipinstruct, VARCHAR l_shipmode, VARCHAR l_suppkey, DOUBLE l_tax)
        rel#57:Subset#0.NONE.[], best=null, importance=0.531441
                rel#11:LogicalTableScan.NONE.[](table=[druid, lineitem]), rowcount=100.0, cumulative cost={inf}
                rel#101:DruidQueryRel.NONE.[](query={"queryType":"scan","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"filter":null,"columns":["__time","count","l_comment","l_commitdate","l_discount","l_extendedprice","l_linenumber","l_linestatus","l_orderkey","l_partkey","l_quantity","l_receiptdate","l_returnflag","l_shipdate","l_shipinstruct","l_shipmode","l_suppkey","l_tax"],"legacy":false,"context":{},"descending":false,"granularity":{"type":"all"}},signature={__time:LONG, count:LONG, l_comment:STRING, l_commitdate:STRING, l_discount:DOUBLE, l_extendedprice:DOUBLE, l_linenumber:STRING, l_linestatus:STRING, l_orderkey:STRING, l_partkey:STRING, l_quantity:LONG, l_receiptdate:STRING, l_returnflag:STRING, l_shipdate:STRING, l_shipinstruct:STRING, l_shipmode:STRING, l_suppkey:STRING, l_tax:DOUBLE}), rowcount=1.0, cumulative cost={inf}
        rel#116:Subset#0.DRUID.[], best=rel#115, importance=0.2657205
                rel#115:DruidQueryRel.DRUID.[](query={"queryType":"scan","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"filter":null,"columns":["__time","count","l_comment","l_commitdate","l_discount","l_extendedprice","l_linenumber","l_linestatus","l_orderkey","l_partkey","l_quantity","l_receiptdate","l_returnflag","l_shipdate","l_shipinstruct","l_shipmode","l_suppkey","l_tax"],"legacy":false,"context":{},"descending":false,"granularity":{"type":"all"}},signature={__time:LONG, count:LONG, l_comment:STRING, l_commitdate:STRING, l_discount:DOUBLE, l_extendedprice:DOUBLE, l_linenumber:STRING, l_linestatus:STRING, l_orderkey:STRING, l_partkey:STRING, l_quantity:LONG, l_receiptdate:STRING, l_returnflag:STRING, l_shipdate:STRING, l_shipinstruct:STRING, l_shipmode:STRING, l_suppkey:STRING, l_tax:DOUBLE}), rowcount=1.0, cumulative cost={1.0 rows, 0.0 cpu, 0.0 io}
Set#1, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT l_quantity)
        rel#59:Subset#1.NONE.[], best=null, importance=0.5904900000000001
                rel#58:LogicalProject.NONE.[](input=rel#57:Subset#0.NONE.[],l_linenumber=$6,l_linestatus=$7,l_quantity=$10), rowcount=100.0, cumulative cost={inf}
                rel#105:DruidQueryRel.NONE.[](query={"queryType":"scan","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"filter":null,"columns":["l_linenumber","l_linestatus","l_quantity"],"legacy":false,"context":{},"descending":false,"granularity":{"type":"all"}},signature={l_linenumber:STRING, l_linestatus:STRING, l_quantity:LONG}), rowcount=1.0, cumulative cost={inf}
        rel#114:Subset#1.DRUID.[], best=rel#113, importance=0.29524500000000004
                rel#113:DruidQueryRel.DRUID.[](query={"queryType":"scan","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"filter":null,"columns":["l_linenumber","l_linestatus","l_quantity"],"legacy":false,"context":{},"descending":false,"granularity":{"type":"all"}},signature={l_linenumber:STRING, l_linestatus:STRING, l_quantity:LONG}), rowcount=1.0, cumulative cost={1.003 rows, 0.0 cpu, 0.0 io}
Set#2, type: RecordType(VARCHAR l_linenumber, BIGINT l_quantity)
        rel#61:Subset#2.NONE.[], best=null, importance=0.4304672100000001
                rel#60:LogicalProject.NONE.[](input=rel#57:Subset#0.NONE.[],l_linenumber=$6,l_quantity=$10), rowcount=100.0, cumulative cost={inf}
                rel#104:DruidQueryRel.NONE.[](query={"queryType":"scan","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"filter":null,"columns":["l_linenumber","l_quantity"],"legacy":false,"context":{},"descending":false,"granularity":{"type":"all"}},signature={l_linenumber:STRING, l_quantity:LONG}), rowcount=1.0, cumulative cost={inf}
        rel#108:Subset#2.DRUID.[], best=rel#107, importance=0.21523360500000005
                rel#107:DruidQueryRel.DRUID.[](query={"queryType":"scan","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"filter":null,"columns":["l_linenumber","l_quantity"],"legacy":false,"context":{},"descending":false,"granularity":{"type":"all"}},signature={l_linenumber:STRING, l_quantity:LONG}), rowcount=1.0, cumulative cost={1.002 rows, 0.0 cpu, 0.0 io}
Set#3, type: RecordType(VARCHAR l_linenumber, BIGINT $f1)
        rel#63:Subset#3.NONE.[], best=null, importance=0.4782969000000001
                rel#62:LogicalAggregate.NONE.[](input=rel#61:Subset#2.NONE.[],group={0},agg#0=SUM($1)), rowcount=10.0, cumulative cost={inf}
                rel#98:LogicalAggregate.NONE.[](input=rel#57:Subset#0.NONE.[],group={6},agg#0=SUM($10)), rowcount=10.0, cumulative cost={inf}
                rel#102:DruidQueryRel.NONE.[](query={"queryType":"groupBy","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"filter":null,"granularity":{"type":"all"},"dimensions":[{"type":"default","dimension":"l_linenumber","outputName":"d0","outputType":"STRING"}],"aggregations":[{"type":"longSum","name":"a0","fieldName":"l_quantity","expression":null}],"postAggregations":[],"having":null,"limitSpec":{"type":"NoopLimitSpec"},"context":{},"descending":false},signature={d0:STRING, a0:LONG}), rowcount=1.0, cumulative cost={inf}
        rel#112:Subset#3.DRUID.[], best=rel#111, importance=0.23914845000000004
                rel#111:DruidQueryRel.DRUID.[](query={"queryType":"groupBy","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"filter":null,"granularity":{"type":"all"},"dimensions":[{"type":"default","dimension":"l_linenumber","outputName":"d0","outputType":"STRING"}],"aggregations":[{"type":"longSum","name":"a0","fieldName":"l_quantity","expression":null}],"postAggregations":[],"having":null,"limitSpec":{"type":"NoopLimitSpec"},"context":{},"descending":false},signature={d0:STRING, a0:LONG}), rowcount=1.0, cumulative cost={0.5650000000000001 rows, 0.0 cpu, 0.0 io}
Set#4, type: RecordType(VARCHAR l_linenumber, BIGINT $f1)
        rel#65:Subset#4.NONE.[1 DESC], best=null, importance=0.531441
                rel#64:LogicalSort.NONE.[1 DESC](input=rel#63:Subset#3.NONE.[],sort0=$1,dir0=DESC,fetch=100), rowcount=10.0, cumulative cost={inf}
                rel#103:DruidQueryRel.NONE.[1 DESC](query={"queryType":"topN","dataSource":{"type":"table","name":"lineitem"},"virtualColumns":[],"dimension":{"type":"default","dimension":"l_linenumber","outputName":"d0","outputType":"STRING"},"metric":{"type":"numeric","metric":"a0"},"threshold":100,"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"filter":null,"granularity":{"type":"all"},"aggregations":[{"type":"longSum","name":"a0","fieldName":"l_quantity","expression":null}],"postAggregations":[],"context":{},"descending":false},signature={d0:STRING, a0:LONG}), rowcount=1.0, cumulative cost={inf}
        rel#110:Subset#4.DRUID.[1 DESC], best=rel#109, importance=0.2657205
                rel#109:DruidQueryRel.DRUID.[1 DESC](query={"queryType":"topN","dataSource":{"type":"table","name":"lineitem"},"virtualColumns":[],"dimension":{"type":"default","dimension":"l_linenumber","outputName":"d0","outputType":"STRING"},"metric":{"type":"numeric","metric":"a0"},"threshold":100,"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"filter":null,"granularity":{"type":"all"},"aggregations":[{"type":"longSum","name":"a0","fieldName":"l_quantity","expression":null}],"postAggregations":[],"context":{},"descending":false},signature={d0:STRING, a0:LONG}), rowcount=1.0, cumulative cost={0.28250000000000003 rows, 0.0 cpu, 0.0 io}
Set#5, type: RecordType(VARCHAR l_linenumber)
        rel#67:Subset#5.NONE.[], best=null, importance=0.5904900000000001
                rel#66:LogicalProject.NONE.[](input=rel#65:Subset#4.NONE.[1 DESC],l_linenumber=$0), rowcount=10.0, cumulative cost={inf}
Set#6, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT l_quantity, VARCHAR l_linenumber0)
        rel#69:Subset#6.NONE.[], best=null, importance=0.6561
                rel#68:LogicalJoin.NONE.[](left=rel#59:Subset#1.NONE.[],right=rel#67:Subset#5.NONE.[],condition==($0, $3),joinType=inner), rowcount=150.0, cumulative cost={inf}
                rel#83:LogicalProject.NONE.[](input=rel#82:Subset#10.NONE.[],l_linenumber=$1,l_linestatus=$2,l_quantity=$3,l_linenumber0=$0), rowcount=150.0, cumulative cost={inf}
Set#7, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT l_quantity)
        rel#71:Subset#7.NONE.[], best=null, importance=0.7290000000000001
                rel#70:LogicalProject.NONE.[](input=rel#69:Subset#6.NONE.[],l_linenumber=$0,l_linestatus=$1,l_quantity=$2), rowcount=150.0, cumulative cost={inf}
                rel#88:LogicalProject.NONE.[](input=rel#82:Subset#10.NONE.[],l_linenumber=$1,l_linestatus=$2,l_quantity=$3), rowcount=150.0, cumulative cost={inf}
Set#8, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT quantity)
        rel#73:Subset#8.NONE.[], best=null, importance=0.81
                rel#72:LogicalAggregate.NONE.[](input=rel#71:Subset#7.NONE.[],group={0, 1},quantity=SUM($2)), rowcount=15.0, cumulative cost={inf}
                rel#78:LogicalAggregate.NONE.[](input=rel#69:Subset#6.NONE.[],group={0, 1},quantity=SUM($2)), rowcount=15.0, cumulative cost={inf}
                rel#87:LogicalAggregate.NONE.[](input=rel#82:Subset#10.NONE.[],group={1, 2},quantity=SUM($3)), rowcount=15.0, cumulative cost={inf}
Set#9, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT quantity)
        rel#75:Subset#9.NONE.[], best=null, importance=0.9
                rel#74:LogicalFilter.NONE.[](input=rel#73:Subset#8.NONE.[],condition=>($2, 0)), rowcount=7.5, cumulative cost={inf}
        rel#76:Subset#9.DRUID.[], best=null, importance=1.0
                rel#77:AbstractConverter.DRUID.[](input=rel#75:Subset#9.NONE.[],convention=DRUID,sort=[]), rowcount=7.5, cumulative cost={inf}
Set#10, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linenumber0, VARCHAR l_linestatus, BIGINT l_quantity)
        rel#82:Subset#10.NONE.[], best=null, importance=0.5904900000000001
                rel#80:LogicalJoin.NONE.[](left=rel#67:Subset#5.NONE.[],right=rel#59:Subset#1.NONE.[],condition==($1, $0),joinType=inner), rowcount=150.0, cumulative cost={inf}
                rel#86:LogicalProject.NONE.[](input=rel#69:Subset#6.NONE.[],l_linenumber=$3,l_linenumber0=$0,l_linestatus=$1,l_quantity=$2), rowcount=150.0, cumulative cost={inf}


        at org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:441) ~[calcite-core-1.15.0.jar:1.15.0]
        at org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:291) ~[calcite-core-1.15.0.jar:1.15.0]
        at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:666) ~[calcite-core-1.15.0.jar:1.15.0]
        at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:368) ~[calcite-core-1.15.0.jar:1.15.0]
        at org.apache.calcite.tools.Programs$SequenceProgram.run(Programs.java:387) ~[calcite-core-1.15.0.jar:1.15.0]
        at org.apache.calcite.prepare.PlannerImpl.transform(PlannerImpl.java:336) ~[calcite-core-1.15.0.jar:1.15.0]
        at io.druid.sql.calcite.planner.DruidPlanner.planWithDruidConvention(DruidPlanner.java:144) ~[druid-sql-0.12.2.jar:0.12.2]
        at io.druid.sql.calcite.planner.DruidPlanner.plan(DruidPlanner.java:112) ~[druid-sql-0.12.2.jar:0.12.2]
        at io.druid.sql.http.SqlResource.doPost(SqlResource.java:88) [druid-sql-0.12.2.jar:0.12.2]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_161]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_161]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_161]
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) [jersey-server-1.19.3.jar:1.19.3]
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) [jersey-servlet-1.19.3.jar:1.19.3]
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558) [jersey-servlet-1.19.3.jar:1.19.3]
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733) [jersey-servlet-1.19.3.jar:1.19.3]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]
        at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286) [guice-servlet-4.1.0.jar:?]
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276) [guice-servlet-4.1.0.jar:?]
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181) [guice-servlet-4.1.0.jar:?]
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) [guice-servlet-4.1.0.jar:?]
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85) [guice-servlet-4.1.0.jar:?]
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120) [guice-servlet-4.1.0.jar:?]
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135) [guice-servlet-4.1.0.jar:?]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
        at io.druid.server.security.PreResponseAuthorizationCheckFilter.doFilter(PreResponseAuthorizationCheckFilter.java:84) [druid-server-0.12.2.jar:0.12.2]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
        at io.druid.server.security.AllowOptionsResourceFilter.doFilter(AllowOptionsResourceFilter.java:76) [druid-server-0.12.2.jar:0.12.2]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
        at io.druid.server.security.AllowAllAuthenticator$1.doFilter(AllowAllAuthenticator.java:85) [druid-server-0.12.2.jar:0.12.2]
        at io.druid.server.security.AuthenticationWrappingFilter.doFilter(AuthenticationWrappingFilter.java:60) [druid-server-0.12.2.jar:0.12.2]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
        at io.druid.server.security.SecuritySanityCheckFilter.doFilter(SecuritySanityCheckFilter.java:86) [druid-server-0.12.2.jar:0.12.2]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:493) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.Server.handle(Server.java:534) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [jetty-io-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [jetty-io-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
        Suppressed: org.apache.calcite.plan.RelOptPlanner$CannotPlanException: Node [rel#171:Subset#20.BINDABLE.[]] could not be implemented; planner state:
Root: rel#171:Subset#20.BINDABLE.[]
Original rel:
LogicalFilter(subset=[rel#171:Subset#20.BINDABLE.[]], condition=[>($2, 0)]): rowcount = 7.5, cumulative cost = {7.5 rows, 15.0 cpu, 0.0 io}, id = 169
  LogicalAggregate(subset=[rel#168:Subset#19.NONE.[]], group=[{0, 1}], quantity=[SUM($2)]): rowcount = 15.0, cumulative cost = {17.062500715255737 rows, 0.0 cpu, 0.0 io}, id = 167
    LogicalProject(subset=[rel#166:Subset#18.NONE.[]], l_linenumber=[$0], l_linestatus=[$1], l_quantity=[$2]): rowcount = 150.0, cumulative cost = {150.0 rows, 450.0 cpu, 0.0 io}, id = 165
      LogicalJoin(subset=[rel#164:Subset#17.NONE.[]], condition=[=($0, $3)], joinType=[inner]): rowcount = 150.0, cumulative cost = {150.0 rows, 0.0 cpu, 0.0 io}, id = 163
        LogicalProject(subset=[rel#154:Subset#12.NONE.[]], l_linenumber=[$6], l_linestatus=[$7], l_quantity=[$10]): rowcount = 100.0, cumulative cost = {100.0 rows, 300.0 cpu, 0.0 io}, id = 153
          LogicalTableScan(subset=[rel#152:Subset#11.NONE.[]], table=[[druid, lineitem]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 11
        LogicalProject(subset=[rel#162:Subset#16.NONE.[]], l_linenumber=[$0]): rowcount = 10.0, cumulative cost = {10.0 rows, 10.0 cpu, 0.0 io}, id = 161
          LogicalSort(subset=[rel#160:Subset#15.NONE.[1 DESC]], sort0=[$1], dir0=[DESC], fetch=[100]): rowcount = 10.0, cumulative cost = {10.0 rows, 184.2068074395237 cpu, 0.0 io}, id = 159
            LogicalAggregate(subset=[rel#158:Subset#14.NONE.[]], group=[{0}], agg#0=[SUM($1)]): rowcount = 10.0, cumulative cost = {11.375000476837158 rows, 0.0 cpu, 0.0 io}, id = 157
              LogicalProject(subset=[rel#156:Subset#13.NONE.[]], l_linenumber=[$6], l_quantity=[$10]): rowcount = 100.0, cumulative cost = {100.0 rows, 200.0 cpu, 0.0 io}, id = 155
                LogicalTableScan(subset=[rel#152:Subset#11.NONE.[]], table=[[druid, lineitem]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 11

Sets:
Set#11, type: RecordType(TIMESTAMP(0) __time, BIGINT count, VARCHAR l_comment, VARCHAR l_commitdate, DOUBLE l_discount, DOUBLE l_extendedprice, VARCHAR l_linenumber, VARCHAR l_linestatus, VARCHAR l_orderkey, VARCHAR l_partkey, BIGINT l_quantity, VARCHAR l_receiptdate, VARCHAR l_returnflag, VARCHAR l_shipdate, VARCHAR l_shipinstruct, VARCHAR l_shipmode, VARCHAR l_suppkey, DOUBLE l_tax)
        rel#152:Subset#11.NONE.[], best=null, importance=0.531441
                rel#11:LogicalTableScan.NONE.[](table=[druid, lineitem]), rowcount=100.0, cumulative cost={inf}
                rel#267:DruidQueryRel.NONE.[](query={"queryType":"scan","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"filter":null,"columns":["__time","count","l_comment","l_commitdate","l_discount","l_extendedprice","l_linenumber","l_linestatus","l_orderkey","l_partkey","l_quantity","l_receiptdate","l_returnflag","l_shipdate","l_shipinstruct","l_shipmode","l_suppkey","l_tax"],"legacy":false,"context":{},"descending":false,"granularity":{"type":"all"}},signature={__time:LONG, count:LONG, l_comment:STRING, l_commitdate:STRING, l_discount:DOUBLE, l_extendedprice:DOUBLE, l_linenumber:STRING, l_linestatus:STRING, l_orderkey:STRING, l_partkey:STRING, l_quantity:LONG, l_receiptdate:STRING, l_returnflag:STRING, l_shipdate:STRING, l_shipinstruct:STRING, l_shipmode:STRING, l_suppkey:STRING, l_tax:DOUBLE}), rowcount=1.0, cumulative cost={inf}
        rel#241:Subset#11.BINDABLE.[], best=null, importance=0.4782969000000001
                rel#240:InterpretableConverter.BINDABLE.[](input=rel#152:Subset#11.NONE.[]), rowcount=100.0, cumulative cost={inf}
Set#12, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT l_quantity)
        rel#154:Subset#12.NONE.[], best=null, importance=0.5904900000000001
                rel#153:LogicalProject.NONE.[](input=rel#152:Subset#11.NONE.[],l_linenumber=$6,l_linestatus=$7,l_quantity=$10), rowcount=100.0, cumulative cost={inf}
                rel#273:DruidQueryRel.NONE.[](query={"queryType":"scan","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"filter":null,"columns":["l_linenumber","l_linestatus","l_quantity"],"legacy":false,"context":{},"descending":false,"granularity":{"type":"all"}},signature={l_linenumber:STRING, l_linestatus:STRING, l_quantity:LONG}), rowcount=1.0, cumulative cost={inf}
        rel#233:Subset#12.BINDABLE.[], best=null, importance=0.531441
                rel#232:InterpretableConverter.BINDABLE.[](input=rel#154:Subset#12.NONE.[]), rowcount=100.0, cumulative cost={inf}
                rel#258:BindableProject.BINDABLE.[](input=rel#241:Subset#11.BINDABLE.[],l_linenumber=$6,l_linestatus=$7,l_quantity=$10), rowcount=100.0, cumulative cost={inf}
Set#13, type: RecordType(VARCHAR l_linenumber, BIGINT l_quantity)
        rel#156:Subset#13.NONE.[], best=null, importance=0.4304672100000001
                rel#155:LogicalProject.NONE.[](input=rel#152:Subset#11.NONE.[],l_linenumber=$6,l_quantity=$10), rowcount=100.0, cumulative cost={inf}
                rel#272:DruidQueryRel.NONE.[](query={"queryType":"scan","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775807,"filter":null,"columns":["l_linenumber","l_quantity"],"legacy":false,"context":{},"descending":false,"granularity":{"type":"all"}},signature={l_linenumber:STRING, l_quantity:LONG}), rowcount=1.0, cumulative cost={inf}
        rel#209:Subset#13.BINDABLE.[], best=null, importance=0.3874204890000001
                rel#208:InterpretableConverter.BINDABLE.[](input=rel#156:Subset#13.NONE.[]), rowcount=100.0, cumulative cost={inf}
                rel#244:BindableProject.BINDABLE.[](input=rel#241:Subset#11.BINDABLE.[],l_linenumber=$6,l_quantity=$10), rowcount=100.0, cumulative cost={inf}
Set#14, type: RecordType(VARCHAR l_linenumber, BIGINT $f1)
        rel#158:Subset#14.NONE.[], best=null, importance=0.4782969000000001
                rel#157:LogicalAggregate.NONE.[](input=rel#156:Subset#13.NONE.[],group={0},agg#0=SUM($1)), rowcount=10.0, cumulative cost={inf}
                rel#198:LogicalAggregate.NONE.[](input=rel#152:Subset#11.NONE.[],group={6},agg#0=SUM($10)), rowcount=10.0, cumulative cost={inf}
                rel#270:DruidQueryRel.NONE.[](query={"queryType":"groupBy","dataSource":{"type":"table","name":"lineitem"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"filter":null,"granularity":{"type":"all"},"dimensions":[{"type":"default","dimension":"l_linenumber","outputName":"d0","outputType":"STRING"}],"aggregations":[{"type":"longSum","name":"a0","fieldName":"l_quantity","expression":null}],"postAggregations":[],"having":null,"limitSpec":{"type":"NoopLimitSpec"},"context":{},"descending":false},signature={d0:STRING, a0:LONG}), rowcount=1.0, cumulative cost={inf}
        rel#205:Subset#14.BINDABLE.[], best=null, importance=0.4304672100000001
                rel#204:InterpretableConverter.BINDABLE.[](input=rel#158:Subset#14.NONE.[]), rowcount=10.0, cumulative cost={inf}
                rel#247:BindableAggregate.BINDABLE.[](input=rel#241:Subset#11.BINDABLE.[],group={6},agg#0=SUM($10)), rowcount=10.0, cumulative cost={inf}
                rel#263:BindableAggregate.BINDABLE.[](input=rel#209:Subset#13.BINDABLE.[],group={0},agg#0=SUM($1)), rowcount=10.0, cumulative cost={inf}
Set#15, type: RecordType(VARCHAR l_linenumber, BIGINT $f1)
        rel#160:Subset#15.NONE.[1 DESC], best=null, importance=0.531441
                rel#159:LogicalSort.NONE.[1 DESC](input=rel#158:Subset#14.NONE.[],sort0=$1,dir0=DESC,fetch=100), rowcount=10.0, cumulative cost={inf}
                rel#271:DruidQueryRel.NONE.[1 DESC](query={"queryType":"topN","dataSource":{"type":"table","name":"lineitem"},"virtualColumns":[],"dimension":{"type":"default","dimension":"l_linenumber","outputName":"d0","outputType":"STRING"},"metric":{"type":"numeric","metric":"a0"},"threshold":100,"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"filter":null,"granularity":{"type":"all"},"aggregations":[{"type":"longSum","name":"a0","fieldName":"l_quantity","expression":null}],"postAggregations":[],"context":{},"descending":false},signature={d0:STRING, a0:LONG}), rowcount=1.0, cumulative cost={inf}
        rel#207:Subset#15.BINDABLE.[1 DESC], best=null, importance=0.4782969000000001
                rel#206:InterpretableConverter.BINDABLE.[1 DESC](input=rel#160:Subset#15.NONE.[1 DESC]), rowcount=10.0, cumulative cost={inf}
                rel#242:BindableSort.BINDABLE.[1 DESC](input=rel#205:Subset#14.BINDABLE.[],sort0=$1,dir0=DESC,fetch=100), rowcount=10.0, cumulative cost={inf}
Set#16, type: RecordType(VARCHAR l_linenumber)
        rel#162:Subset#16.NONE.[], best=null, importance=0.5904900000000001
                rel#161:LogicalProject.NONE.[](input=rel#160:Subset#15.NONE.[1 DESC],l_linenumber=$0), rowcount=10.0, cumulative cost={inf}
        rel#202:Subset#16.BINDABLE.[], best=null, importance=0.531441
                rel#201:InterpretableConverter.BINDABLE.[](input=rel#162:Subset#16.NONE.[]), rowcount=10.0, cumulative cost={inf}
                rel#243:BindableProject.BINDABLE.[](input=rel#207:Subset#15.BINDABLE.[1 DESC],l_linenumber=$0), rowcount=10.0, cumulative cost={inf}
Set#17, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT l_quantity, VARCHAR l_linenumber0)
        rel#164:Subset#17.NONE.[], best=null, importance=0.6561
                rel#163:LogicalJoin.NONE.[](left=rel#154:Subset#12.NONE.[],right=rel#162:Subset#16.NONE.[],condition==($0, $3),joinType=inner), rowcount=150.0, cumulative cost={inf}
                rel#183:LogicalProject.NONE.[](input=rel#182:Subset#21.NONE.[],l_linenumber=$1,l_linestatus=$2,l_quantity=$3,l_linenumber0=$0), rowcount=150.0, cumulative cost={inf}
        rel#239:Subset#17.BINDABLE.[], best=null, importance=0.5904900000000001
                rel#238:InterpretableConverter.BINDABLE.[](input=rel#164:Subset#17.NONE.[]), rowcount=150.0, cumulative cost={inf}
                rel#260:BindableProject.BINDABLE.[](input=rel#236:Subset#21.BINDABLE.[],l_linenumber=$1,l_linestatus=$2,l_quantity=$3,l_linenumber0=$0), rowcount=150.0, cumulative cost={inf}
                rel#262:BindableJoin.BINDABLE.[](left=rel#233:Subset#12.BINDABLE.[],right=rel#202:Subset#16.BINDABLE.[],condition==($0, $3),joinType=inner), rowcount=150.0, cumulative cost={inf}
Set#18, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT l_quantity)
        rel#166:Subset#18.NONE.[], best=null, importance=0.7290000000000001
                rel#165:LogicalProject.NONE.[](input=rel#164:Subset#17.NONE.[],l_linenumber=$0,l_linestatus=$1,l_quantity=$2), rowcount=150.0, cumulative cost={inf}
                rel#188:LogicalProject.NONE.[](input=rel#182:Subset#21.NONE.[],l_linenumber=$1,l_linestatus=$2,l_quantity=$3), rowcount=150.0, cumulative cost={inf}
                rel#287:LogicalProject.NONE.[](input=rel#236:Subset#21.BINDABLE.[],l_linenumber=$1,l_linestatus=$2,l_quantity=$3), rowcount=150.0, cumulative cost={inf}
                rel#292:LogicalProject.NONE.[](input=rel#239:Subset#17.BINDABLE.[],l_linenumber=$0,l_linestatus=$1,l_quantity=$2), rowcount=150.0, cumulative cost={inf}
        rel#212:Subset#18.BINDABLE.[], best=null, importance=0.81
                rel#211:InterpretableConverter.BINDABLE.[](input=rel#166:Subset#18.NONE.[]), rowcount=150.0, cumulative cost={inf}
                rel#245:BindableProject.BINDABLE.[](input=rel#236:Subset#21.BINDABLE.[],l_linenumber=$1,l_linestatus=$2,l_quantity=$3), rowcount=150.0, cumulative cost={inf}
                rel#246:BindableProject.BINDABLE.[](input=rel#239:Subset#17.BINDABLE.[],l_linenumber=$0,l_linestatus=$1,l_quantity=$2), rowcount=150.0, cumulative cost={inf}
Set#19, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT quantity)
        rel#168:Subset#19.NONE.[], best=null, importance=0.81
                rel#167:LogicalAggregate.NONE.[](input=rel#166:Subset#18.NONE.[],group={0, 1},quantity=SUM($2)), rowcount=15.0, cumulative cost={inf}
                rel#178:LogicalAggregate.NONE.[](input=rel#164:Subset#17.NONE.[],group={0, 1},quantity=SUM($2)), rowcount=15.0, cumulative cost={inf}
                rel#187:LogicalAggregate.NONE.[](input=rel#182:Subset#21.NONE.[],group={1, 2},quantity=SUM($3)), rowcount=15.0, cumulative cost={inf}
                rel#288:LogicalAggregate.NONE.[](input=rel#236:Subset#21.BINDABLE.[],group={1, 2},quantity=SUM($3)), rowcount=15.0, cumulative cost={inf}
                rel#294:LogicalAggregate.NONE.[](input=rel#239:Subset#17.BINDABLE.[],group={0, 1},quantity=SUM($2)), rowcount=15.0, cumulative cost={inf}
        rel#176:Subset#19.BINDABLE.[], best=null, importance=0.9
                rel#214:InterpretableConverter.BINDABLE.[](input=rel#168:Subset#19.NONE.[]), rowcount=15.0, cumulative cost={inf}
                rel#264:BindableAggregate.BINDABLE.[](input=rel#236:Subset#21.BINDABLE.[],group={1, 2},quantity=SUM($3)), rowcount=15.0, cumulative cost={inf}
                rel#265:BindableAggregate.BINDABLE.[](input=rel#239:Subset#17.BINDABLE.[],group={0, 1},quantity=SUM($2)), rowcount=15.0, cumulative cost={inf}
                rel#266:BindableAggregate.BINDABLE.[](input=rel#212:Subset#18.BINDABLE.[],group={0, 1},quantity=SUM($2)), rowcount=15.0, cumulative cost={inf}
Set#20, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linestatus, BIGINT quantity)
        rel#170:Subset#20.NONE.[], best=null, importance=0.9
                rel#169:LogicalFilter.NONE.[](input=rel#168:Subset#19.NONE.[],condition=>($2, 0)), rowcount=7.5, cumulative cost={inf}
        rel#171:Subset#20.BINDABLE.[], best=null, importance=1.0
                rel#172:AbstractConverter.BINDABLE.[](input=rel#170:Subset#20.NONE.[],convention=BINDABLE,sort=[]), rowcount=7.5, cumulative cost={inf}
                rel#173:InterpretableConverter.BINDABLE.[](input=rel#170:Subset#20.NONE.[]), rowcount=7.5, cumulative cost={inf}
                rel#177:BindableFilter.BINDABLE.[[]](input=rel#176:Subset#19.BINDABLE.[],condition=>($2, 0)), rowcount=7.5, cumulative cost={inf}
Set#21, type: RecordType(VARCHAR l_linenumber, VARCHAR l_linenumber0, VARCHAR l_linestatus, BIGINT l_quantity)
        rel#182:Subset#21.NONE.[], best=null, importance=0.5904900000000001
                rel#180:LogicalJoin.NONE.[](left=rel#162:Subset#16.NONE.[],right=rel#154:Subset#12.NONE.[],condition==($1, $0),joinType=inner), rowcount=150.0, cumulative cost={inf}
                rel#186:LogicalProject.NONE.[](input=rel#164:Subset#17.NONE.[],l_linenumber=$3,l_linenumber0=$0,l_linestatus=$1,l_quantity=$2), rowcount=150.0, cumulative cost={inf}
        rel#236:Subset#21.BINDABLE.[], best=null, importance=0.6561
                rel#235:InterpretableConverter.BINDABLE.[](input=rel#182:Subset#21.NONE.[]), rowcount=150.0, cumulative cost={inf}
                rel#259:BindableProject.BINDABLE.[](input=rel#239:Subset#17.BINDABLE.[],l_linenumber=$3,l_linenumber0=$0,l_linestatus=$1,l_quantity=$2), rowcount=150.0, cumulative cost={inf}
                rel#261:BindableJoin.BINDABLE.[](left=rel#202:Subset#16.BINDABLE.[],right=rel#233:Subset#12.BINDABLE.[],condition==($1, $0),joinType=inner), rowcount=150.0, cumulative cost={inf}


                at org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:441) ~[calcite-core-1.15.0.jar:1.15.0]
                at org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:291) ~[calcite-core-1.15.0.jar:1.15.0]
                at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:666) ~[calcite-core-1.15.0.jar:1.15.0]
                at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:368) ~[calcite-core-1.15.0.jar:1.15.0]
                at org.apache.calcite.tools.Programs$SequenceProgram.run(Programs.java:387) ~[calcite-core-1.15.0.jar:1.15.0]
                at org.apache.calcite.prepare.PlannerImpl.transform(PlannerImpl.java:336) ~[calcite-core-1.15.0.jar:1.15.0]
                at io.druid.sql.calcite.planner.DruidPlanner.planWithBindableConvention(DruidPlanner.java:265) ~[druid-sql-0.12.2.jar:0.12.2]
                at io.druid.sql.calcite.planner.DruidPlanner.plan(DruidPlanner.java:117) ~[druid-sql-0.12.2.jar:0.12.2]
                at io.druid.sql.http.SqlResource.doPost(SqlResource.java:88) [druid-sql-0.12.2.jar:0.12.2]
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_161]
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_161]
                at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_161]
                at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) [jersey-server-1.19.3.jar:1.19.3]
                at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) [jersey-servlet-1.19.3.jar:1.19.3]
                at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558) [jersey-servlet-1.19.3.jar:1.19.3]
                at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733) [jersey-servlet-1.19.3.jar:1.19.3]
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]
                at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286) [guice-servlet-4.1.0.jar:?]
                at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276) [guice-servlet-4.1.0.jar:?]
                at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181) [guice-servlet-4.1.0.jar:?]
                at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) [guice-servlet-4.1.0.jar:?]
                at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85) [guice-servlet-4.1.0.jar:?]
                at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120) [guice-servlet-4.1.0.jar:?]
                at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135) [guice-servlet-4.1.0.jar:?]
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
                at io.druid.server.security.PreResponseAuthorizationCheckFilter.doFilter(PreResponseAuthorizationCheckFilter.java:84) [druid-server-0.12.2.jar:0.12.2]
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
                at io.druid.server.security.AllowOptionsResourceFilter.doFilter(AllowOptionsResourceFilter.java:76) [druid-server-0.12.2.jar:0.12.2]
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
                at io.druid.server.security.AllowAllAuthenticator$1.doFilter(AllowAllAuthenticator.java:85) [druid-server-0.12.2.jar:0.12.2]
                at io.druid.server.security.AuthenticationWrappingFilter.doFilter(AuthenticationWrappingFilter.java:60) [druid-server-0.12.2.jar:0.12.2]
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
                at io.druid.server.security.SecuritySanityCheckFilter.doFilter(SecuritySanityCheckFilter.java:86) [druid-server-0.12.2.jar:0.12.2]
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:493) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.Server.handle(Server.java:534) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [jetty-io-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [jetty-io-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
                at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]
                at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
@jihoonson jihoonson added this to the 0.12.3 milestone Aug 22, 2018
@jihoonson
Copy link
Contributor Author

jihoonson commented Aug 22, 2018

I've tested 0.12.2 with #5788 and it works. Do we need to backport it to 0.12.3?

@gianm
Copy link
Contributor

gianm commented Aug 22, 2018

Sure, I think we might as well. It straddles the line between a feature and a bug fix, but it does look like it's enough of a bug fix (esp. since this query used to work) that we should backport it.

@jihoonson
Copy link
Contributor Author

@gianm thanks. I'll backport it.

@gianm
Copy link
Contributor

gianm commented Aug 25, 2018

I backported this in #6228, and I will close this issue since it's fixed by #5788.

@gianm gianm closed this as completed Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants