<div dir="ltr"><div>the query is quite simple <br></div><div><br></div>Is this the only test failing on your branch ?<div><br></div><div>If this is the only one I will checkout locally your branch, maybe they changed the way Calcite is to be configured and we have to change the bootstrap of the Planner</div><div><br></div><div><br></div><div><br><div><br></div><div>Enrico</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 18 lug 2019 alle ore 03:45 Amit Chavan <<a href="mailto:achavan1@gmail.com">achavan1@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<br><div><br></div><div>I am upgrading herddb dependency to calcite 1.20.0 and ran into an issue with calcite volcano planner. The query in question is "SELECT MIN(n1) as mi, MAX(n1) as ma FROM tblspace1.tsql WHERE k1='no_results' GROUP BY k1". The unit test in question is </div><div> <a href="https://github.com/diennea/herddb/blob/master/herddb-core/src/test/java/herddb/core/RawSQLTest.java#L1389" target="_blank">https://github.com/diennea/herddb/blob/master/herddb-core/src/test/java/herddb/core/RawSQLTest.java#L1389</a></div><div><br></div><div>The error I am getting is --</div><div>java.lang.RuntimeException: Error while applying rule ProjectScanRule:interpreter, args [rel#264:EnumerableProject.ENUMERABLE.[](input=RelSubset#263,MI=$1,MA=$1), rel#317:EnumerableInterpreter.ENUMERABLE.[](input=RelSubset#291), rel#290:BindableTableScan.BINDABLE.[](table=[tblspace1, tsql],filters=[=($0, 'no_results')])]<br><br>        at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:235)<br>        at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:631)<br>        at herddb.sql.CalcitePlanner.runPlanner(CalcitePlanner.java:527)<br>        at herddb.sql.CalcitePlanner.translate(CalcitePlanner.java:293)<br>        at herddb.core.TestUtils.scan(TestUtils.java:70)<br>        at herddb.core.RawSQLTest.simpleMinMaxTest(RawSQLTest.java:1389)<br>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>        at java.lang.reflect.Method.invoke(Method.java:497)<br>        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)<br>        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)<br>        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)<br>        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)<br>        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)<br>        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)<br>        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)<br>        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)<br>        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)<br>        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)<br>        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)<br>        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)<br>        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)<br>        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)<br>        at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)<br>        at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)<br>        at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)<br>        at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)<br>Caused by: java.lang.IllegalArgumentException: source #1 is already mapped to target #1<br>        at org.apache.calcite.util.mapping.Mappings$SurjectionWithInverse.set(Mappings.java:1326)<br>        at org.apache.calcite.rel.core.Project.getMapping(Project.java:279)<br>        at org.apache.calcite.rel.core.Project.getMapping(Project.java:250)<br>        at org.apache.calcite.rel.rules.ProjectTableScanRule.apply(ProjectTableScanRule.java:107)<br>        at org.apache.calcite.rel.rules.ProjectTableScanRule$2.onMatch(ProjectTableScanRule.java:83)<br>        at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:208)<br>        ... 27 more<br></div><div><br></div><div>What is the right approach to handle this? Can we file a bug with the calcite team.</div></div>
_______________________________________________<br>
herddb-dev mailing list<br>
<a href="mailto:herddb-dev@lists.herddb.org" target="_blank">herddb-dev@lists.herddb.org</a><br>
<a href="http://lists.herddb.org/mailman/listinfo/herddb-dev" rel="noreferrer" target="_blank">http://lists.herddb.org/mailman/listinfo/herddb-dev</a><br>
</blockquote></div>