You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2021/11/30 05:08:00 UTC

[jira] [Commented] (CALCITE-4909) In SubstituteVisitor, if there is a calc on target's agg, the query will not be rewritten by materialized view.

    [ https://issues.apache.org/jira/browse/CALCITE-4909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17450851#comment-17450851 ] 

Julian Hyde commented on CALCITE-4909:
--------------------------------------

What do you mean "there is a calc"? Do you mean there is a {{Calc}} RelNode?

Can you format your code example using JIRA's 'code' tag. Better still, explain in English which is the query, and which is the materialized view definition, and why you think it should match.

> 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
>
> sql("select 'a',\"empid\",\"deptno\",sum(\"salary\") as s from \"emps\" group by \"empid\",\"deptno\"", "select sum(\"salary\") +1 as s,\"deptno\" from \"emps\" group by \"deptno\"").noMat(); 
> In substitute processing, this case will not be rewritten by materialized view because there is a calc 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)