Hi,

I'm having problems getting the Volcano Planner to implement my Rel tree. I 
keep getting errors like "could not be implemented; planner state"

My target tree has 2 conventions. The first is what i'm calling a "Native" 
convention which is similar to the JdbcConvention in its semantics, but I dont 
use the JdbcConvention because it forces me to create JdbcTableScans that need 
an instance of a live jdbc Datasource. The second convention I have is called 
Foo (for lack of a better name), using which I intend to physically implement 
or execute my Rel tree.

Here is my original rel, which i built using a 2 Relbuilders (1 Relbuilder 
built using a custom TableScanFactory and the other Relbuilder built using an 
empty Context i.e default TableScanFactory)

LogicalProject
--NativeTableScan


To implement this tree, I have a few rules set up such as,

NativeToFooConverterRule (similar to JdbcToEnumerableConverterRule)
NativeProjectRule (similar to JdbcProjectRule)


I register these rules inside of the NativeConvention in the register method 
(similar to JdbcConvention). For now, i've hardcoded the cost (row count) of 
the NativeTable object (which reside inside RelOptSchema) to be 100. The 
planner state, after it fails is below. In case the full log with TRACE levels 
is needed, i've attached it here. https://tinyurl.com/yct3hnle

java.lang.RuntimeException: 
org.apache.calcite.plan.RelOptPlanner$CannotPlanException: Node 
[rel#4:Subset#1.NONE.[]] could not be implemented; planner state:

Root: rel#4:Subset#1.NONE.[]

Original rel:
LogicalProject(subset=[rel#4:Subset#1.NONE.[]], id=[$0]): rowcount = 100.0, 
cumulative cost = {100.0 rows, 100.0 cpu, 0.0 io}, id = 3
  NativeTableScan(subset=[rel#2:Subset#0.NativeTeradataConvention.[]], 
table=[[s1, emp]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 
0.0 io}, id = 0

Sets:
Set#0, type: RecordType(INTEGER id, VARCHAR name, INTEGER department)
        rel#2:Subset#0.NativeTeradataConvention.[], best=rel#0, importance=0.9
        rel#0:NativeTableScan.NativeTeradataConvention.[](table=[s1, emp]), 
rowcount=100.0, cumulative cost={100.0 rows, 101.0 cpu, 0.0 io}
    rel#5:Subset#0.ENUMERABLE.[], best=null, importance=0.45
    rel#15:Subset#0.BeamConvention.[], best=rel#14, importance=0.45
        
rel#14:NativeToBeamConverterRel.BeamConvention.[](input=rel#2:Subset#0.NativeTeradataConvention.[]),
 rowcount=100.0, cumulative cost={110.0 rows, 111.0 cpu, 0.0 io}
Set#1, type: RecordType(INTEGER id)
        rel#4:Subset#1.NONE.[], best=null, importance=1.0
        
rel#3:LogicalProject.NONE.[](input=rel#2:Subset#0.NativeTeradataConvention.[],id=$0),
 rowcount=100.0, cumulative cost={inf}
    rel#7:Subset#1.ENUMERABLE.[], best=null, importance=0.5
        
rel#6:EnumerableProject.ENUMERABLE.[](input=rel#5:Subset#0.ENUMERABLE.[],id=$0),
 rowcount=100.0, cumulative cost={inf}
    rel#9:Subset#1.NativeTeradataConvention.[], best=rel#8, importance=0.5
        
rel#8:NativeProject.NativeTeradataConvention.[](input=rel#2:Subset#0.NativeTeradataConvention.[],id=$0),
 rowcount=100.0, cumulative cost={180.0 rows, 181.0 cpu, 0.0 io}
rel#11:Subset#1.BeamConvention.[], best=rel#10, importance=0.5
    
rel#10:NativeToBeamConverterRel.BeamConvention.[](input=rel#9:Subset#1.NativeTeradataConvention.[]),
 rowcount=100.0, cumulative cost={190.0 rows, 191.0 cpu, 0.0 io}

I tried referring to this email on the mailing list, but so far no luck.
https://mail-archives.apache.org/mod_mbox/calcite-dev/201606.mbox/%3ccfa8c0e7e88fc641b42fb1b7e70fc487b8bc8...@szxema508-mbx.china.huawei.com%3e

Thanks
Abbas

Reply via email to