[
https://issues.apache.org/jira/browse/CALCITE-4909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ziwei Liu updated CALCITE-4909:
-------------------------------
Description:
{code:java}
matialized view: select 'a',empid,deptno,sum(salary) as s from emps group by
empid,deptno;
sql: select sum(salary) +1 as s,deptno from emps group by deptno;
{code}
In substitute processing, this case will not be rewritten by materialized view
because there is a Calc RelNode on target's agg. We may need a rule
AggregateOnCalcToCalcOnAggregateUnifyRule to handle this condition.
was:
matialized view: select 'a',empid,deptno,sum(salary) as s from emps group by
empid,deptno;
sql: select sum(salary) +1 as s,deptno from emps group by deptno;
In substitute processing, this case will not be rewritten by materialized view
because there is a Calc RelNode on target's agg. We may need a rule
AggregateOnCalcToCalcOnAggregateUnifyRule to handle this condition.
> In SubstituteVisitor, if there is a calc on target's agg, the query will not
> be rewritten by materialized view.
> ---------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-4909
> URL: https://issues.apache.org/jira/browse/CALCITE-4909
> Project: Calcite
> Issue Type: Improvement
> Reporter: Ziwei Liu
> Assignee: Ziwei Liu
> Priority: Major
>
> {code:java}
> matialized view: select 'a',empid,deptno,sum(salary) as s from emps group by
> empid,deptno;
> sql: select sum(salary) +1 as s,deptno from emps group by deptno;
> {code}
> In substitute processing, this case will not be rewritten by materialized
> view because there is a Calc RelNode on target's agg. We may need a rule
> AggregateOnCalcToCalcOnAggregateUnifyRule to handle this condition.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)