This means you miss some rule(s) to convert from "None" convention to
"Logical" convention.
In particular, in the trace you posted:
Set#2, type: RecordType(VARCHAR(10) productId, INTEGER units)
rel#15:Subset#2.NONE.[], best=null, importance=0.9
rel#14:LogicalDelta.NONE.[](input=rel#13:Subset#1.NONE.[]),
rowcount=100.0, cumulative cost={inf}
rel#21:LogicalProject.NONE.[](input=rel#20:Subset#3.NONE.[],productId=$1,units=$2),
rowcount=100.0, cumulative cost={inf}
rel#16:Subset#2.LOGICAL.[], best=null, importance=1.0
*rel#17:AbstractConverter.LOGICAL.*[](input=*rel#15:Subset#2*
.NONE.[],convention=LOGICAL,sort=[]),
rowcount=100.0, cumulative cost={inf}
RelSubSet #16 only has one rel node #17, whose input is rel#15:Subset#2.
Seems you do not have rule
to convert LogicalDelta.NONE or LogicalProject.NONE to a RelNode in LOGICAL
convention. As a result,
the cumulative cost is infinity, and "best" is null. That's why
VolcanoPlanner will report CanNotPlan error.
btw: the trace you posted seems to be not well formated.
On Fri, Sep 4, 2015 at 11:02 AM, Milinda Pathirage <[email protected]>
wrote:
> Hi Devs,
>
> I am getting following error when I tried PlannerImpl#transform with a
> custom set of rules (but all rules are from Calcite). Please let me know if
> anyone have any ideas about a possible reason for this error.
>
> org.apache.calcite.plan.RelOptPlanner$CannotPlanException: Node
> [rel#16:Subset#2.LOGICAL.[]] could not be implemented; planner state:
>
> Root: rel#16:Subset#2.LOGICAL.[]
> Original rel:
>
> Sets:
> Set#0, type: RecordType(INTEGER id, VARCHAR(10) productId, INTEGER
> units, TIMESTAMP(0) rowtime)
> rel#11:Subset#0.NONE.[], best=null, importance=0.7290000000000001
> rel#3:LogicalTableScan.NONE.[](table=[KAFKA, ORDERS]), rowcount=100.0,
> cumulative cost={inf}
> Set#1, type: RecordType(VARCHAR(10) productId, INTEGER units)
> rel#13:Subset#1.NONE.[], best=null, importance=0.81
>
> rel#12:LogicalProject.NONE.[](input=rel#11:Subset#0.NONE.[],productId=$1,units=$2),
> rowcount=100.0, cumulative cost={inf}
> Set#2, type: RecordType(VARCHAR(10) productId, INTEGER units)
> rel#15:Subset#2.NONE.[], best=null, importance=0.9
> rel#14:LogicalDelta.NONE.[](input=rel#13:Subset#1.NONE.[]),
> rowcount=100.0, cumulative cost={inf}
>
> rel#21:LogicalProject.NONE.[](input=rel#20:Subset#3.NONE.[],productId=$1,units=$2),
> rowcount=100.0, cumulative cost={inf}
> rel#16:Subset#2.LOGICAL.[], best=null, importance=1.0
>
> rel#17:AbstractConverter.LOGICAL.[](input=rel#15:Subset#2.NONE.[],convention=LOGICAL,sort=[]),
> rowcount=100.0, cumulative cost={inf}
> Set#3, type: RecordType(INTEGER id, VARCHAR(10) productId, INTEGER
> units, TIMESTAMP(0) rowtime)
> rel#20:Subset#3.NONE.[], best=null, importance=0.81
> rel#18:LogicalDelta.NONE.[](input=rel#11:Subset#0.NONE.[]),
> rowcount=100.0, cumulative cost={inf}
> rel#22:LogicalTableScan.NONE.[[3]](table=[]), rowcount=100.0,
> cumulative cost={inf}
> rel#23:Subset#3.NONE.[3], best=null, importance=0.405
> rel#22:LogicalTableScan.NONE.[[3]](table=[]), rowcount=100.0,
> cumulative cost={inf}
> at
>
> org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:473)
> at
>
> org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:317)
> at
>
> org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:823)
> at
> org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:303)
> at
> org.apache.calcite.prepare.PlannerImpl.transform(PlannerImpl.java:268)
> at
>
> org.apache.samza.sql.planner.QueryPlanner.convertToSamzaRel(QueryPlanner.java:115)
> at
>
> org.apache.samza.sql.planner.QueryPlanner.validateAndConvert(QueryPlanner.java:109)
> at
> org.apache.samza.sql.planner.QueryPlanner.getPlan(QueryPlanner.java:98)
> at
>
> org.apache.samza.sql.planner.TestQueryPlanner.testSimpleProject(TestQueryPlanner.java:108)
>
>
> I haven't seen this before. I got this after I changed my code to use
> Frameworks#getPlanner.
>
> Thanks in advance
> Milinda
>
> --
> 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
>