You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Xurenhe (Jira)" <ji...@apache.org> on 2021/08/14 08:23:00 UTC
[jira] [Commented] (CALCITE-4735) Unify Rules in
SubstitutionVisitor should be adjusted.
[ https://issues.apache.org/jira/browse/CALCITE-4735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17399142#comment-17399142 ]
Xurenhe commented on CALCITE-4735:
----------------------------------
Hi, [~yanlin-Lynn] [~jinxing6042@126.com][~hyuan]
Please take time to look at this view, and I will be very glad to receive your response.
> Unify Rules in SubstitutionVisitor should be adjusted.
> ------------------------------------------------------
>
> 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)