I'm not convinced there aren't better alternatives, so I hope we can continue to explore this. Specifically with respect to the statement "It means there's not enough rules to produce the node with desired properties", it would be great if we could more clearly identify what properties the missing node should have that are missing from the nodes which have been previously generated.
In any case, what you have is definitely much better than what we have now. I don't see a good reason not to commit and we can always improve later. Thanks Vladimir -- Michael Mior [email protected] Le sam. 2 févr. 2019 à 12:46, Vladimir Sitnikov <[email protected]> a écrit : > > Julian>It really bugs me that it takes a couple of hours of careful reading > of the log to figure out that for your new Foo Convention you have a > FooProjectRule > > I guess this case can be improved by searching the leaf empty subsets. > > I've filed https://github.com/apache/calcite/pull/1024 which does that. > For missing EnumerableAggregateRule it produces the following message. > > I think it is more-or-less human-readable, and it does point to > LogicalAggregate nodes. > > I'm going to commit it unless there are better alternatives. > > Node > rel#169:Subset#10.ENUMERABLE.[] is not implementable. It means there's not > enough rules to produce the node with desired properties > There are 4 empty subsets: > Leaf 0: rel#259:Subset#4.ENUMERABLE.[] > 145:LogicalAggregate(group=[{0}]) > 139:LogicalProject(subset=[rel#140:Subset#1.NONE.[]], deptno=[$1]) > 82:EnumerableTableScan(subset=[rel#138:Subset#0.ENUMERABLE.[]], > table=[[hr, emps]]) > > Leaf 1: rel#256:Subset#1.ENUMERABLE.[0] > 139:LogicalProject(deptno=[$1]) > 82:EnumerableTableScan(subset=[rel#138:Subset#0.ENUMERABLE.[]], > table=[[hr, emps]]) > > Leaf 2: rel#255:Subset#8.ENUMERABLE.[0] > 153:LogicalAggregate(group=[{0}]) > 151:LogicalProject(subset=[rel#152:Subset#7.NONE.[]], deptno0=[$1]) > 149:LogicalFilter(subset=[rel#150:Subset#6.NONE.[]], condition=[<=($0, > $1)]) > 147:LogicalJoin(subset=[rel#148:Subset#5.NONE.[]], condition=[>=($0, > $1)], joinType=[inner]) > 142:LogicalProject(subset=[rel#143:Subset#3.NONE.[]], deptno=[$0]) > 84:EnumerableTableScan(subset=[rel#141:Subset#2.ENUMERABLE.[]], > table=[[hr, depts]]) > 145:LogicalAggregate(subset=[rel#146:Subset#4.NONE.[]], group=[{0}]) > 139:LogicalProject(subset=[rel#140:Subset#1.NONE.[]], deptno=[$1]) > 82:EnumerableTableScan(subset=[rel#138:Subset#0.ENUMERABLE.[]], > table=[[hr, emps]]) > > Leaf 3: rel#273:Subset#8.ENUMERABLE.[] > 153:LogicalAggregate(group=[{0}]) > 151:LogicalProject(subset=[rel#152:Subset#7.NONE.[]], deptno0=[$1]) > 149:LogicalFilter(subset=[rel#150:Subset#6.NONE.[]], condition=[<=($0, > $1)]) > 147:LogicalJoin(subset=[rel#148:Subset#5.NONE.[]], condition=[>=($0, > $1)], joinType=[inner]) > 142:LogicalProject(subset=[rel#143:Subset#3.NONE.[]], deptno=[$0]) > 84:EnumerableTableScan(subset=[rel#141:Subset#2.ENUMERABLE.[]], > table=[[hr, depts]]) > 145:LogicalAggregate(subset=[rel#146:Subset#4.NONE.[]], group=[{0}]) > 139:LogicalProject(subset=[rel#140:Subset#1.NONE.[]], deptno=[$1]) > 82:EnumerableTableScan(subset=[rel#138:Subset#0.ENUMERABLE.[]], > table=[[hr, emps]]) > > Root: rel#169:Subset#10.ENUMERABLE.[] > Original rel: > LogicalProject(deptno=[$0]): rowcount = 375.0, cumulative cost = {2385.0 > rows, 1728.0 cpu, 0.0 io}, id = 137 > LogicalJoin(condition=[=($0, $1)], joinType=[inner]): rowcount = 375.0, > cumulative cost = {2010.0 rows, 1353.0 cpu, 0.0 io}, id = 136 > LogicalProject(deptno=[$1]): rowcount = 100.0, cumulative cost = {200.0 > rows, 201.0 cpu, 0.0 io}, id = 127 > EnumerableTableScan(table=[[hr, emps]]): rowcount = 100.0, cumulative > cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 82 > LogicalAggregate(group=[{0}]): rowcount = 25.0, cumulative cost = > {1435.0 rows, 1152.0 cpu, 0.0 io}, id = 135 > LogicalProject(deptno0=[$1]): rowcount = 250.0, cumulative cost = > {1410.0 rows, 1152.0 cpu, 0.0 io}, id = 134 > LogicalFilter(condition=[<=($0, $1)]): rowcount = 250.0, cumulative > cost = {1160.0 rows, 902.0 cpu, 0.0 io}, id = 133 > LogicalJoin(condition=[>=($0, $1)], joinType=[inner]): rowcount = > 500.0, cumulative cost = {910.0 rows, 402.0 cpu, 0.0 io}, id = 132 > LogicalProject(deptno=[$0]): rowcount = 100.0, cumulative cost > = {200.0 rows, 201.0 cpu, 0.0 io}, id = 128 > EnumerableTableScan(table=[[hr, depts]]): rowcount = 100.0, > cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 84 > LogicalAggregate(group=[{0}]): rowcount = 10.0, cumulative cost > = {210.0 rows, 201.0 cpu, 0.0 io}, id = 131 > LogicalProject(deptno=[$1]): rowcount = 100.0, cumulative > cost = {200.0 rows, 201.0 cpu, 0.0 io}, id = 130 > EnumerableTableScan(table=[[hr, emps]]): rowcount = 100.0, > cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 82 > > Sets: > Set#0, type: RecordType(JavaType(int) empid, JavaType(int) deptno, > JavaType(class java.lang.String) name, JavaType(float) salary, > JavaType(class java.lang.Integer) commission) > rel#138:Subset#0.ENUMERABLE.[], best=rel#82, importance=0.6561 > rel#82:EnumerableTableSc... > > Vladimir
