You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/06/13 07:45:00 UTC

[jira] [Updated] (CALCITE-3060) Materialized view: "target out of range" error

     [ https://issues.apache.org/jira/browse/CALCITE-3060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated CALCITE-3060:
------------------------------------
    Labels: pull-request-available  (was: )

> Materialized view: "target out of range" error
> ----------------------------------------------
>
>                 Key: CALCITE-3060
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3060
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.19.0
>            Reporter: Anton Haidai
>            Priority: Major
>              Labels: pull-request-available
>
> "MaterializationTest":
> {code}
> @Test public void testPermutationError() {
>     CalciteAssert.that()
>         .withMaterializations(
>             HR_FKUK_MODEL,
>             "m0",
>             "select min(\"salary\"), count(*), max(\"salary\"), sum(\"salary\"), \"empid\" from \"emps\" group by \"empid\"",
>             "m1",
>             "select min(\"salary\"), count(*), max(\"salary\"), sum(\"salary\"), \"deptno\", \"empid\" from \"emps\" group by \"empid\", \"deptno\""
>         )
>         .query(
>             "select count(*), \"empid\" from \"emps\" group by \"empid\"")
>         .enableMaterializations(true)
>         .explainContains("EnumerableTableScan(table=[[hr, m0]])")
>         .sameResultWithMaterializationsDisabled();
>   }
> {code}
> Error (looks like the mapping is expected to be bijection but it is not):
> {code}
> Caused by: java.lang.IllegalArgumentException: target out of range
> 	at org.apache.calcite.util.Permutation.<init>(Permutation.java:69)
> 	at org.apache.calcite.util.mapping.Mappings.bijection(Mappings.java:394)
> 	at org.apache.calcite.rel.mutable.MutableRels.createProject(MutableRels.java:142)
> 	at org.apache.calcite.plan.SubstitutionVisitor.unifyAggregates(SubstitutionVisitor.java:1269)
> 	at org.apache.calcite.plan.SubstitutionVisitor$AggregateOnProjectToAggregateUnifyRule.apply(SubstitutionVisitor.java:1345)
> 	at org.apache.calcite.plan.SubstitutionVisitor.go(SubstitutionVisitor.java:531)
> 	at org.apache.calcite.plan.SubstitutionVisitor.go(SubstitutionVisitor.java:466)	
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)