You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "asdfgh19 (Jira)" <ji...@apache.org> on 2023/03/21 10:53:00 UTC

[jira] [Updated] (CALCITE-5594) AggregateStarTableRule optimized plan does not get the same result to the original one

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

asdfgh19 updated CALCITE-5594:
------------------------------
    Summary: AggregateStarTableRule optimized plan does not get the same result to the original one  (was: LatticeTest#testLatticeWithNoMeasures returns results not as expected)

> AggregateStarTableRule optimized plan does not get the same result to the original one
> --------------------------------------------------------------------------------------
>
>                 Key: CALCITE-5594
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5594
>             Project: Calcite
>          Issue Type: Test
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: asdfgh19
>            Priority: Minor
>
>   I changed the test testLatticeWithNoMeasures in LatticeTest to the following and ran, it returned 4.
>   After that I changed enableMaterializations to false and re-run, the result returned 86837.
>   Wondering why the results returned from the materialized view and from the original table are inconsistent.
> {code:java}
> @Test void testLatticeWithNoMeasures() {
>   foodmartModel(" auto: false,\n"
>       + "  tiles: [ {\n"
>       + "    dimensions: [ 'the_year', ['t', 'quarter'] ],\n"
>       + "    measures: [ ]\n"
>       + "  } ]\n")
>       .query("select count(*)\n"
>           + "from \"foodmart\".\"sales_fact_1997\" as s\n"
>           + "join \"foodmart\".\"time_by_day\" as t using (\"time_id\")\n")
>       .enableMaterializations(true)
>       .returns(rs -> {
>         try {
>           while (rs.next()) {
>             System.out.println(rs.getObject(1));
>           }
>         } catch (Exception e) {
>           fail(e);
>         }
>       });
> } {code}
>   The explain looks like this, should the original count be replaced by sum(count) in the materialized view, like MaterializedViewRelOptRulesTest#testAggregateMaterializationAggregateFuncs2.
> {code:java}
> EnumerableAggregate(group=[{}], EXPR$0=[COUNT()])
>   EnumerableTableScan(table=[[adhoc, m{32, 36} {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)