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/10/19 05:57:00 UTC
[jira] [Comment Edited] (CALCITE-4857) Materialization-Failed,
query could be grouping mv's agg-call, when executing mv-match.
[ 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, 5:56 AM:
-------------------------------------------------------------
[~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.
I give a complex case as follow:
{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 cube(deptno, salary)
{code}
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.
I give a complex case as follow:
-- 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 cube(deptno, salary)
> 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)