Hi Ravikumar, Please go through your planner state and figure out which rels are still in NONE convention. Once you fix your converter rules the error will go away.
Thanks Milinda On Wed, Jun 22, 2016 at 11:33 AM, Ravikumar CS <[email protected]> wrote: > I ran into a similar issue with VolcanoPlanner. Not sure how to get past > this. > > > Exception in thread "main" > org.apache.calcite.plan.RelOptPlanner$CannotPlanException: Node > [rel#17:Subset#3.NONE.[]] could not be implemented; planner state: > > Root: rel#17:Subset#3.NONE.[] > Original rel: > LogicalAggregate(subset=[rel#17:Subset#3.NONE.[]], group=[{0}], > EXPR$1=[SUM($1)]): rowcount = 5.0, cumulative cost = {5.687500238418579 > rows, 0.0 cpu, 0.0 io}, id = 16 > LogicalFilter(subset=[rel#15:Subset#2.NONE.[]], condition=[>($0, 1)]): > rowcount = 50.0, cumulative cost = {50.0 rows, 100.0 cpu, 0.0 io}, id = 14 > LogicalProject(subset=[rel#13:Subset#1.NONE.[]], id=[$0], units=[$2]): > rowcount = 100.0, cumulative cost = {100.0 rows, 200.0 cpu, 0.0 io}, id = > 12 > LogicalTableScan(subset=[rel#11:Subset#0.NONE.[]], table=[[SALES, > Orders1]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 > io}, id = 4 > > Sets: > Set#0, type: RecordType(INTEGER id, VARCHAR(10) product, INTEGER units) > rel#11:Subset#0.NONE.[], best=null, importance=0.7290000000000001 > rel#4:LogicalTableScan.NONE.[](table=[SALES, Orders1]), rowcount=100.0, > cumulative cost={inf} > rel#53:Subset#0.BINDABLE.[], best=rel#52, importance=0.5904900000000001 > rel#52:BindableTableScan.BINDABLE.[](table=[SALES, Orders1]), > rowcount=100.0, cumulative cost={1.0 rows, 1.01 cpu, 0.0 io} > rel#55:Subset#0.ENUMERABLE.[], best=rel#69, importance=0.6561 > rel#54:EnumerableTableScan.ENUMERABLE.[](table=[SALES, Orders1]), > rowcount=100.0, cumulative cost={100.0 rows, 101.0 cpu, 0.0 io} > > rel#69:EnumerableInterpreter.ENUMERABLE.[](input=rel#53:Subset#0.BINDABLE.[]), > rowcount=100.0, cumulative cost={51.0 rows, 51.01 cpu, 0.0 io} > Set#1, type: RecordType(INTEGER id, INTEGER units) > rel#13:Subset#1.NONE.[], best=null, importance=0.81 > > rel#12:LogicalProject.NONE.[](input=rel#11:Subset#0.NONE.[],id=$0,units=$2), > rowcount=100.0, cumulative cost={inf} > rel#60:Subset#1.ENUMERABLE.[], best=rel#59, importance=0.7290000000000001 > > rel#59:EnumerableProject.ENUMERABLE.[](input=rel#55:Subset#0.ENUMERABLE.[],id=$0,units=$2), > rowcount=100.0, cumulative cost={151.0 rows, 251.01 cpu, 0.0 io} > Set#2, type: RecordType(INTEGER id, INTEGER units) > rel#15:Subset#2.NONE.[], best=null, importance=0.9 > rel#14:LogicalFilter.NONE.[](input=rel#13:Subset#1.NONE.[],condition=>($0, > 1)), rowcount=50.0, cumulative cost={inf} > > rel#41:LogicalProject.NONE.[](input=rel#40:Subset#4.NONE.[],id=$0,units=$2), > rowcount=50.0, cumulative cost={inf} > rel#34:Subset#2.ENUMERABLE.[], best=rel#56, importance=0.81 > > rel#56:EnumerableProject.ENUMERABLE.[](input=rel#43:Subset#4.ENUMERABLE.[],id=$0,units=$2), > rowcount=50.0, cumulative cost={151.0 rows, 251.01 cpu, 0.0 io} > > rel#61:EnumerableFilter.ENUMERABLE.[](input=rel#60:Subset#1.ENUMERABLE.[],condition=>($0, > 1)), rowcount=50.0, cumulative cost={201.0 rows, 351.01 cpu, 0.0 io} > Set#3, type: RecordType(INTEGER id, INTEGER EXPR$1) > rel#17:Subset#3.NONE.[], best=null, importance=1.0 > > rel#16:LogicalAggregate.NONE.[](input=rel#15:Subset#2.NONE.[],group={0},EXPR$1=SUM($1)), > rowcount=5.0, cumulative cost={inf} > > rel#32:AbstractConverter.NONE.[](input=rel#31:Subset#3.ENUMERABLE.[],convention=NONE,sort=[]), > rowcount=5.0, cumulative cost={inf} > > rel#36:LogicalAggregate.NONE.[](input=rel#15:Subset#2.NONE.[],group={0},EXPR$1=$SUM0($1)), > rowcount=5.0, cumulative cost={inf} > > rel#42:LogicalAggregate.NONE.[](input=rel#40:Subset#4.NONE.[],group={0},EXPR$1=$SUM0($2)), > rowcount=5.0, cumulative cost={inf} > > rel#45:LogicalAggregate.NONE.[](input=rel#40:Subset#4.NONE.[],group={0},EXPR$1=SUM($2)), > rowcount=5.0, cumulative cost={inf} > rel#31:Subset#3.ENUMERABLE.[], best=rel#44, importance=0.9 > > rel#33:AbstractConverter.ENUMERABLE.[](input=rel#17:Subset#3.NONE.[],convention=ENUMERABLE,sort=[]), > rowcount=5.0, cumulative cost={inf} > > rel#35:EnumerableAggregate.ENUMERABLE.[](input=rel#34:Subset#2.ENUMERABLE.[],group={0},EXPR$1=SUM($1)), > rowcount=5.0, cumulative cost={156.68750023841858 rows, 251.01 cpu, 0.0 io} > > rel#37:EnumerableAggregate.ENUMERABLE.[](input=rel#34:Subset#2.ENUMERABLE.[],group={0},EXPR$1=$SUM0($1)), > rowcount=5.0, cumulative cost={156.625 rows, 251.01 cpu, 0.0 io} > > rel#44:EnumerableAggregate.ENUMERABLE.[](input=rel#43:Subset#4.ENUMERABLE.[],group={0},EXPR$1=$SUM0($2)), > rowcount=5.0, cumulative cost={106.625 rows, 151.01 cpu, 0.0 io} > > rel#46:EnumerableAggregate.ENUMERABLE.[](input=rel#43:Subset#4.ENUMERABLE.[],group={0},EXPR$1=SUM($2)), > rowcount=5.0, cumulative cost={106.68750023841858 rows, 151.01 cpu, 0.0 io} > Set#4, type: RecordType(INTEGER id, VARCHAR(10) product, INTEGER units) > rel#40:Subset#4.NONE.[], best=null, importance=0.81 > rel#38:LogicalFilter.NONE.[](input=rel#11:Subset#0.NONE.[],condition=>($0, > 1)), rowcount=50.0, cumulative cost={inf} > rel#43:Subset#4.ENUMERABLE.[], best=rel#62, importance=0.7290000000000001 > > rel#62:EnumerableFilter.ENUMERABLE.[](input=rel#55:Subset#0.ENUMERABLE.[],condition=>($0, > 1)), rowcount=50.0, cumulative cost={101.0 rows, 151.01 cpu, 0.0 io} > at > > org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:443) > at > > org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:293) > at > > org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:841) > at > > com.calcite.prototype.queryengine.BasicQueryPlanner.main(BasicQueryPlanner.java:133) > > > On Tue, Jun 21, 2016 at 8:33 PM, Zhangrucong <[email protected]> > wrote: > > > Hi everyone, > > > > I want to test calcite optimization of volcano planner with null cost > > factory. To avoid implementing some RelNodes and ConvertRules, I use > > BindableConvention trait set to transform converted RelNode. The > > QueryPlanner references to the implementation of SamzaSQL: > > > > > > > https://github.com/milinda/samza-sql/blob/master/samza-sql-planner/src/main/java/org/apache/samza/sql/planner/QueryPlanner.java > > > > I replace the SamzaLogicalConvention.INSTANCE with the > > BindableConvention.INSTANCE and remove the HepPlanner optimization. > > > > With the simple SQL test("select stream * from orders"), the volcano > > planner always complains following errors: > > > > org.apache.calcite.plan.RelOptPlanner$CannotPlanException: Node > > [rel#11:Subset#2.BINDABLE.[]] could not be implemented; planner state: > > > > Root: rel#11:Subset#2.BINDABLE.[] > > Original rel: > > > > Sets: > > Set#0, type: RecordType(INTEGER orderId, INTEGER productId) > > rel#6:Subset#0.ENUMERABLE.[], best=rel#3, > importance=0.7290000000000001 > > rel#3:EnumerableTableScan.ENUMERABLE.[](table=[orders]), > > rowcount=100.0, cumulative cost={100.0 rows, 101.0 cpu, 0.0 io} > > rel#20:Subset#0.BINDABLE.[], best=null, > importance=0.36450000000000005 > > Set#1, type: RecordType(INTEGER orderId, INTEGER productId) > > rel#8:Subset#1.NONE.[], best=null, importance=0.81 > > > > > rel#7:LogicalProject.NONE.[](input=rel#6:Subset#0.ENUMERABLE.[],orderId=$0,productId=$1), > > rowcount=100.0, cumulative cost={inf} > > rel#17:Subset#1.BINDABLE.[], best=null, importance=0.405 > > > > rel#16:InterpretableConverter.BINDABLE.[](input=rel#8:Subset#1.NONE.[]), > > rowcount=100.0, cumulative cost={inf} > > > > > rel#21:BindableProject.BINDABLE.[](input=rel#20:Subset#0.BINDABLE.[],orderId=$0,productId=$1), > > rowcount=100.0, cumulative cost={inf} > > Set#2, type: RecordType(INTEGER orderId, INTEGER productId) > > rel#10:Subset#2.NONE.[], best=null, importance=0.9 > > rel#9:LogicalDelta.NONE.[](input=rel#8:Subset#1.NONE.[]), > > rowcount=100.0, cumulative cost={inf} > > rel#11:Subset#2.BINDABLE.[], best=null, importance=1.0 > > > > > rel#12:AbstractConverter.BINDABLE.[](input=rel#10:Subset#2.NONE.[],convention=BINDABLE,sort=[]), > > rowcount=100.0, cumulative cost={inf} > > > > > rel#13:InterpretableConverter.BINDABLE.[](input=rel#10:Subset#2.NONE.[]), > > rowcount=100.0, cumulative cost={inf} > > > > at > > > org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:443) > > at > > > org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:293) > > at > > > org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:841) > > at > > org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:334) > > at > > org.apache.calcite.prepare.PlannerImpl.transform(PlannerImpl.java:290) > > > > I have no idea what to do with the runtime exceptions. Anything did I > > forget ? Or Did I misuse the BindableConvention trait set ? > > > > Thanks. > > > > > > > -- Milinda Pathirage PhD Student | Research Assistant School of Informatics and Computing | Data to Insight Center Indiana University twitter: milindalakmal skype: milinda.pathirage blog: http://milinda.pathirage.org
