[Herddb-dev] Potential calcite bug

Enrico Olivelli eolivelli at gmail.com
Thu Jul 18 11:31:28 CEST 2019


the query is quite simple

Is this the only test failing on your branch ?

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




Enrico

Il giorno gio 18 lug 2019 alle ore 03:45 Amit Chavan <achavan1 at gmail.com>
ha scritto:

> Hello,
>
> 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
>
> https://github.com/diennea/herddb/blob/master/herddb-core/src/test/java/herddb/core/RawSQLTest.java#L1389
>
> The error I am getting is --
> 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')])]
>
> at
> org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:235)
> at
> org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:631)
> at herddb.sql.CalcitePlanner.runPlanner(CalcitePlanner.java:527)
> at herddb.sql.CalcitePlanner.translate(CalcitePlanner.java:293)
> at herddb.core.TestUtils.scan(TestUtils.java:70)
> at herddb.core.RawSQLTest.simpleMinMaxTest(RawSQLTest.java:1389)
> 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:497)
> 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)
> Caused by: java.lang.IllegalArgumentException: source #1 is already mapped
> to target #1
> at
> org.apache.calcite.util.mapping.Mappings$SurjectionWithInverse.set(Mappings.java:1326)
> at org.apache.calcite.rel.core.Project.getMapping(Project.java:279)
> at org.apache.calcite.rel.core.Project.getMapping(Project.java:250)
> at
> org.apache.calcite.rel.rules.ProjectTableScanRule.apply(ProjectTableScanRule.java:107)
> at
> org.apache.calcite.rel.rules.ProjectTableScanRule$2.onMatch(ProjectTableScanRule.java:83)
> at
> org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:208)
> ... 27 more
>
> What is the right approach to handle this? Can we file a bug with the
> calcite team.
> _______________________________________________
> herddb-dev mailing list
> herddb-dev at lists.herddb.org
> http://lists.herddb.org/mailman/listinfo/herddb-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.herddb.org/pipermail/herddb-dev/attachments/20190718/e1c9e454/attachment.html>


More information about the herddb-dev mailing list