[
https://issues.apache.org/jira/browse/CALCITE-4735?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xurenhe updated CALCITE-4735:
-----------------------------
Summary: Some SubstitutionVisitor for (was: Unify Rules in
SubstitutionVisitor should be adjusted.)
> Some SubstitutionVisitor for
> ----------------------------
>
> Key: CALCITE-4735
> URL: https://issues.apache.org/jira/browse/CALCITE-4735
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Xurenhe
> Priority: Major
>
> I think that executing query-rewriting by mv, sub of `UnifyRule` should be
> check which query's rel whether is rewrited by target's rel, which is matched
> in UnifyRule.
> Let me give you an example of the current failure.
> {code:java}
> @Test void testAggCallArgExpressedByMvProjs() {
> final String mv = ""
> + "select \"deptno\", \"name\""
> + "from \"emps\" group by \"deptno\", \"name\"";
> final String query = ""
> + "select \"deptno\", \"name\", count(distinct \"name\")"
> + "from \"emps\" group by \"deptno\", \"name\"";
> sql(mv, query).ok();
> }
> {code}
> In AggregateToAggregateUnifyRule, when executing `unifyAggregates`, we could
> find agg-calls of query could be expressed by agg-groups of target, we could
> add some new agg-calls to fill target's agg-calls.
> Please review this viewpoint, if this viewpoint is right, I can do it.
> Thanks a lot.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)