calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Haidai (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CALCITE-3060) Materialized view: "target out of range" error
Date Fri, 10 May 2019 15:06:01 GMT
Anton Haidai created CALCITE-3060:
-------------------------------------

             Summary: 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


"MaterializationTest":
{code}
@Test public void testPremutationError() {
    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)

Mime
View raw message