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.