org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There are not enough rules to produce a node with desired properties: convention=ENUMERABLE, sort=[]. All the inputs have relevant nodes, however the cost is still infinite. Root: rel#13:Subset#2.ENUMERABLE.[] Original rel: LogicalJoin(subset=[rel#13:Subset#2.ENUMERABLE.[]], condition=[=($7, $8)], joinType=[inner]): rowcount = 117.6, cumulative cost = {117.6 rows, 0.0 cpu, 0.0 io}, id = 11 LogicalUnion(subset=[rel#9:Subset#1.NONE.[]], all=[true]): rowcount = 28.0, cumulative cost = {28.0 rows, 28.0 cpu, 0.0 io}, id = 8 LogicalTableScan(subset=[rel#7:Subset#0.NONE.[0]], table=[[scott, EMP]]): rowcount = 14.0, cumulative cost = {14.0 rows, 15.0 cpu, 0.0 io}, id = 0 LogicalTableScan(subset=[rel#7:Subset#0.NONE.[0]], table=[[scott, EMP]]): rowcount = 14.0, cumulative cost = {14.0 rows, 15.0 cpu, 0.0 io}, id = 0 LogicalUnion(subset=[rel#9:Subset#1.NONE.[]], all=[true]): rowcount = 28.0, cumulative cost = {28.0 rows, 28.0 cpu, 0.0 io}, id = 8 LogicalTableScan(subset=[rel#7:Subset#0.NONE.[0]], table=[[scott, EMP]]): rowcount = 14.0, cumulative cost = {14.0 rows, 15.0 cpu, 0.0 io}, id = 0 LogicalTableScan(subset=[rel#7:Subset#0.NONE.[0]], table=[[scott, EMP]]): rowcount = 14.0, cumulative cost = {14.0 rows, 15.0 cpu, 0.0 io}, id = 0 Sets: Set#0, type: RecordType(SMALLINT EMPNO, VARCHAR(10) ENAME, VARCHAR(9) JOB, SMALLINT MGR, DATE HIREDATE, DECIMAL(7, 2) SAL, DECIMAL(7, 2) COMM, TINYINT DEPTNO) rel#7:Subset#0.NONE.[0], best=null, importance=0.7290000000000001 rel#0:LogicalTableScan.NONE.[0](table=[scott, EMP]), rowcount=14.0, cumulative cost={inf} rel#23:Subset#0.ENUMERABLE.[0], best=rel#25, importance=0.81 rel#25:EnumerableTableScan.ENUMERABLE.[0](table=[scott, EMP]), rowcount=14.0, cumulative cost={14.0 rows, 15.0 cpu, 0.0 io} Set#1, type: RecordType(SMALLINT EMPNO, VARCHAR(10) ENAME, VARCHAR(9) JOB, SMALLINT MGR, DATE HIREDATE, DECIMAL(7, 2) SAL, DECIMAL(7, 2) COMM, TINYINT DEPTNO) rel#9:Subset#1.NONE.[], best=null, importance=0.81 rel#8:LogicalUnion.NONE.[](input#0=RelSubset#7,input#1=RelSubset#7,all=true), rowcount=28.0, cumulative cost={inf} rel#19:Subset#1.ENUMERABLE.[], best=rel#22, importance=0.9 rel#22:EnumerableUnion.ENUMERABLE.[](input#0=RelSubset#23,input#1=RelSubset#23,all=true), rowcount=28.0, cumulative cost={56.0 rows, 58.0 cpu, 0.0 io} Set#2, type: RecordType(SMALLINT EMPNO, VARCHAR(10) ENAME, VARCHAR(9) JOB, SMALLINT MGR, DATE HIREDATE, DECIMAL(7, 2) SAL, DECIMAL(7, 2) COMM, TINYINT DEPTNO, SMALLINT EMPNO0, VARCHAR(10) ENAME0, VARCHAR(9) JOB0, SMALLINT MGR0, DATE HIREDATE0, DECIMAL(7, 2) SAL0, DECIMAL(7, 2) COMM0, TINYINT DEPTNO0) rel#12:Subset#2.NONE.[], best=null, importance=0.9 rel#11:LogicalJoin.NONE.[](left=RelSubset#9,right=RelSubset#9,condition==($7, $8),joinType=inner), rowcount=117.6, cumulative cost={inf} rel#18:LogicalCorrelate.NONE.[](left=RelSubset#9,right=RelSubset#17,correlation=$cor0,joinType=inner,requiredColumns={7}), rowcount=1.0, cumulative cost={inf} rel#13:Subset#2.ENUMERABLE.[], best=null, importance=1.0 rel#14:AbstractConverter.ENUMERABLE.[](input=RelSubset#12,convention=ENUMERABLE,sort=[]), rowcount=117.6, cumulative cost={inf} rel#21:EnumerableCorrelate.ENUMERABLE.[](left=RelSubset#19,right=RelSubset#20,correlation=$cor0,joinType=inner,requiredColumns={7}), rowcount=1.0, cumulative cost={1770.6000000000001 rows, 2466.0 cpu, 0.0 io} Set#3, type: RecordType(SMALLINT EMPNO, VARCHAR(10) ENAME, VARCHAR(9) JOB, SMALLINT MGR, DATE HIREDATE, DECIMAL(7, 2) SAL, DECIMAL(7, 2) COMM, TINYINT DEPTNO) rel#17:Subset#3.NONE.[], best=null, importance=0.81 rel#15:LogicalFilter.NONE.[](input=RelSubset#9,condition==($cor0.DEPTNO, $0)), rowcount=4.2, cumulative cost={inf} rel#20:Subset#3.ENUMERABLE.[], best=rel#24, importance=0.9 rel#24:EnumerableFilter.ENUMERABLE.[](input=RelSubset#19,condition==($cor0.DEPTNO, $0)), rowcount=4.2, cumulative cost={60.2 rows, 86.0 cpu, 0.0 io} Graphviz: digraph G { root [style=filled,label="Root"]; subgraph cluster0{ label="Set 0 RecordType(SMALLINT EMPNO, VARCHAR(10) ENAME, VARCHAR(9) JOB, SMALLINT MGR, DATE HIREDATE, DECIMAL(7, 2) SAL, DECIMAL(7, 2) COMM, TINYINT DEPTNO)"; rel0 [label="rel#0:LogicalTableScan\ntable=[scott, EMP]\nrows=14.0, cost={inf}",shape=box] rel25 [label="rel#25:EnumerableTableScan\ntable=[scott, EMP]\nrows=14.0, cost={14.0 rows, 15.0 cpu, 0.0 io}",color=blue,shape=box] subset7 [label="rel#7:Subset#0.NONE.[0]"] subset23 [label="rel#23:Subset#0.ENUMERABLE.[0]"] } subgraph cluster1{ label="Set 1 RecordType(SMALLINT EMPNO, VARCHAR(10) ENAME, VARCHAR(9) JOB, SMALLINT MGR, DATE HIREDATE, DECIMAL(7, 2) SAL, DECIMAL(7, 2) COMM, TINYINT DEPTNO)"; rel8 [label="rel#8:LogicalUnion\ninput#0=RelSubset#7,input#1=RelSubset#7,all=true\nrows=28.0, cost={inf}",shape=box] rel22 [label="rel#22:EnumerableUnion\ninput#0=RelSubset#23,input#1=RelSubset#23,all=true\nrows=28.0, cost={56.0 rows, 58.0 cpu, 0.0 io}",color=blue,shape=box] subset9 [label="rel#9:Subset#1.NONE.[]"] subset19 [label="rel#19:Subset#1.ENUMERABLE.[]"] } subgraph cluster2{ label="Set 2 RecordType(SMALLINT EMPNO, VARCHAR(10) ENAME, VARCHAR(9) JOB, SMALLINT MGR, DATE HIREDATE, DECIMAL(7, 2) SAL, DECIMAL(7, 2) COMM, TINYINT DEPTNO, SMALLINT EMPNO0, VARCHAR(10) ENAME0, VARCHAR(9) JOB0, SMALLINT MGR0, DATE HIREDATE0, DECIMAL(7, 2) SAL0, DECIMAL(7, 2) COMM0, TINYINT DEPTNO0)"; rel11 [label="rel#11:LogicalJoin\nleft=RelSubset#9,right=RelSubset#9,condition==($7, $8),joinType=inner\nrows=117.6, cost={inf}",shape=box] rel14 [label="rel#14:AbstractConverter\ninput=RelSubset#12,convention=ENUMERABLE,sort=[]\nrows=117.6, cost={inf}",shape=box] rel18 [label="rel#18:LogicalCorrelate\nleft=RelSubset#9,right=RelSubset#17,correlation=$cor0,joinType=inner,requiredColumns={7}\nrows=1.0, cost={inf}",shape=box] rel21 [label="rel#21:EnumerableCorrelate\nleft=RelSubset#19,right=RelSubset#20,correlation=$cor0,joinType=inner,requiredColumns={7}\nrows=1.0, cost={1770.6000000000001 rows, 2466.0 cpu, 0.0 io}",shape=box] subset12 [label="rel#12:Subset#2.NONE.[]"] subset13 [label="rel#13:Subset#2.ENUMERABLE.[]"] } subgraph cluster3{ label="Set 3 RecordType(SMALLINT EMPNO, VARCHAR(10) ENAME, VARCHAR(9) JOB, SMALLINT MGR, DATE HIREDATE, DECIMAL(7, 2) SAL, DECIMAL(7, 2) COMM, TINYINT DEPTNO)"; rel15 [label="rel#15:LogicalFilter\ninput=RelSubset#9,condition==($cor0.DEPTNO, $0)\nrows=4.2, cost={inf}",shape=box] rel24 [label="rel#24:EnumerableFilter\ninput=RelSubset#19,condition==($cor0.DEPTNO, $0)\nrows=4.2, cost={60.2 rows, 86.0 cpu, 0.0 io}",color=blue,shape=box] subset17 [label="rel#17:Subset#3.NONE.[]"] subset20 [label="rel#20:Subset#3.ENUMERABLE.[]"] } root -> subset13; subset7 -> rel0; subset23 -> rel25[color=blue]; subset9 -> rel8; rel8 -> subset7[label="0"]; rel8 -> subset7[label="1"]; subset19 -> rel22[color=blue]; rel22 -> subset23[color=blue,label="0"]; rel22 -> subset23[color=blue,label="1"]; subset12 -> rel11; rel11 -> subset9[label="0"]; rel11 -> subset9[label="1"]; subset13 -> rel14; rel14 -> subset12; subset12 -> rel18; rel18 -> subset9[label="0"]; rel18 -> subset17[label="1"]; subset13 -> rel21; rel21 -> subset19[label="0"]; rel21 -> subset20[label="1"]; subset17 -> rel15; rel15 -> subset9; subset20 -> rel24[color=blue]; rel24 -> subset19[color=blue]; } at org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:603) at org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:304) at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:647) at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:327) at org.apache.calcite.tools.PlannerTest.testCannotPlanException(PlannerTest.java:721) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)