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

ASF GitHub Bot updated CALCITE-7493:
------------------------------------
    Labels: pull-request-available  (was: )

> Support constant-result aggregates (e.g., STDDEV_POP, STDDEV) over GROUP BY 
> keys
> --------------------------------------------------------------------------------
>
>                 Key: CALCITE-7493
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7493
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.41.0
>            Reporter: Yu Xu
>            Assignee: Yu Xu
>            Priority: Major
>              Labels: pull-request-available
>
> Sql like:
> {code:java}
> select sal, stddev(sal) as sd,
> stddev_pop(sal) as sdp, var_pop(sal) as vp, var_samp(sal) as vs
> from emp group by sal, deptno {code}
>  
> It should be able to be optimized to:
> ||agg funcions||Better simplified results||
> |{{STDDEV(sal)}}|{{0}}|
> |{{STDDEV_POP(sal)}}|{{0}}|
> and current plan:
> {code:java}
> LogicalProject(SAL=[$0], SD=[$3], SDP=[$4], VP=[$5], VS=[$6])
>   LogicalAggregate(group=[{0, 1}], SD=[STDDEV($0)], SDP=[STDDEV_POP($0)], 
> VP=[VAR_POP($0)], VS=[VAR_SAMP($0)])
>     LogicalProject(SAL=[$5], DEPTNO=[$7])
>       LogicalTableScan(table=[[CATALOG, SALES, EMP]]) {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to