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

Xurenhe edited comment on CALCITE-4857 at 10/19/21, 1:04 PM:
-------------------------------------------------------------

[~yanlin-Lynn] [~nobigo] 
 Thanks for your reply. 

[~yanlin-Lynn] I agree with your advise to simplify query's plan, which is only 
working in simple group type of aggregate.

Of course, current code support complex group type in rolling up query.

Thanks your remind, I think simplified rule is same important.

Both Simplifying RelNode and fixing in 
`org.apache.calcite.plan.SubstitutionVisitor#unifyAggregates` are ok for me.

Hi, [~yuanhsh] [~Ziwei Liu] [~xzh_dz] 
 How about you, which way is better?

 


was (Author: wojustme):
[~yanlin-Lynn] [~nobigo] 
 Thanks for your reply. 

[~yanlin-Lynn] I agree with your advise to simplify query's plan, which is only 
working in simple group type of aggregate.

Of course, current code support complex group type in rolling up query.

Thanks your remind, I think simplified rule is same important.



Both Simplifying and fixing in 
`org.apache.calcite.plan.SubstitutionVisitor#unifyAggregates` are ok for me.



Hi, [~yuanhsh] [~Ziwei Liu] [~xzh_dz] 
How about you, which way is better?

 

> Materialization-Failed, query could be grouping mv's agg-call, when executing 
> mv-match.
> ---------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4857
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4857
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Xurenhe
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2021-10-18-11-18-02-312.png
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Here, query could be rewritten by mv, but it's failed now.
> {code:java}
> -- mv: 
> select deptno, salary, min(commission) as commission_min 
> from emps 
> group by deptno, salary
> -- query: 
> select deptno, salary, max(salary), min(commission) 
> from emps 
> group by deptno, salary
> -- after mv match
> select deptno, salary, max(salary), commission_min
> from mv
> group by deptno, salary, commission_min
> {code}
>  
> !image-2021-10-18-11-18-02-312.png!  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to