[
https://issues.apache.org/jira/browse/CALCITE-5594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
asdfgh19 updated CALCITE-5594:
------------------------------
Description:
I added a test case to LatticeTest and it fails as shown below.
{code:java}
@Test void testLatticeWithNoMeasures3() {
foodmartModel(" auto: false,\n"
+ " tiles: [ {\n"
+ " dimensions: [ 'the_year', ['t', 'month_of_year'] ],\n"
+ " measures: [ ]\n"
+ " } ]\n")
.query("select \"the_year\", max(\"month_of_year\"),
count(\"month_of_year\")\n"
+ "from \"foodmart\".\"sales_fact_1997\" as s\n"
+ "join \"foodmart\".\"time_by_day\" as t using (\"time_id\")\n"
+ "group by \"the_year\"")
.enableMaterializations(false)
.sameResultWithMaterializationsDisabled();
}{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}
was:
I added a test case to LatticeTest and it fails as shown below.
{code:java}
@Test void testLatticeWithNoMeasures2() {
foodmartModel(" auto: false,\n"
+ " tiles: [ {\n"
+ " dimensions: [ 'the_year', ['t', 'month_of_year'] ],\n"
+ " measures: [ ]\n"
+ " } ]\n")
.query("select \"the_year\", min(\"month_of_year\"),
max(\"month_of_year\")\n"
+ "from \"foodmart\".\"sales_fact_1997\" as s\n"
+ "join \"foodmart\".\"time_by_day\" as t using (\"time_id\")\n"
+ "group by \"the_year\"")
.enableMaterializations(true)
.sameResultWithMaterializationsDisabled();
}{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}
> 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 added a test case to LatticeTest and it fails as shown below.
> {code:java}
> @Test void testLatticeWithNoMeasures3() {
> foodmartModel(" auto: false,\n"
> + " tiles: [ {\n"
> + " dimensions: [ 'the_year', ['t', 'month_of_year'] ],\n"
> + " measures: [ ]\n"
> + " } ]\n")
> .query("select \"the_year\", max(\"month_of_year\"),
> count(\"month_of_year\")\n"
> + "from \"foodmart\".\"sales_fact_1997\" as s\n"
> + "join \"foodmart\".\"time_by_day\" as t using (\"time_id\")\n"
> + "group by \"the_year\"")
> .enableMaterializations(false)
> .sameResultWithMaterializationsDisabled();
> }{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)