flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aljoscha Krettek (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FLINK-7144) Optimize multiple LogicalAggregate into one
Date Fri, 22 Mar 2019 09:53:00 GMT

     [ https://issues.apache.org/jira/browse/FLINK-7144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aljoscha Krettek updated FLINK-7144:
------------------------------------
    Component/s:     (was: Table SQL / API)
                 Table SQL / Legacy Planner

> Optimize multiple LogicalAggregate into one
> -------------------------------------------
>
>                 Key: FLINK-7144
>                 URL: https://issues.apache.org/jira/browse/FLINK-7144
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Legacy Planner
>            Reporter: Jark Wu
>            Assignee: Rong Rong
>            Priority: Major
>
> When applying multiple GROUP BY, and no aggregates or expression in the first GROUP BY,
 and the second GROUP fields is a subset of first GROUP fields. Then the first GROUP BY can
be removed. 
> Such as the following SQL , 
> {code}
> SELECT a FROM (SELECT a,b,c FROM MyTable GROUP BY a, b, c) GROUP BY a
> {code}
> should be optimized into 
> {code}
> DataStreamGroupAggregate(groupBy=[a], select=[a])
> DataStreamCalc(select=[a])
> DataStreamScan(table=[[_DataStreamTable_0]])
> {code}
> but get:
> {code}
> DataStreamGroupAggregate(groupBy=[a], select=[a])
> DataStreamCalc(select=[a])
> DataStreamGroupAggregate(groupBy=[a, b, c], select=[a, b, c])
> DataStreamScan(table=[[_DataStreamTable_0]])
> {code}
> I looked for the Calcite built-in rules, but can't find a match one. So maybe we should
implement one , and maybe we should implement it in Calcite. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message