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

Mihai Budiu resolved CALCITE-6531.
----------------------------------
    Resolution: Fixed

Fixed in 
https://github.com/apache/calcite/commit/7fa73c0079b03b8cd9657df0058a5743b80c1be9

> Correct Javadoc example in SqlStaticAggFunction#constant
> --------------------------------------------------------
>
>                 Key: CALCITE-6531
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6531
>             Project: Calcite
>          Issue Type: Task
>          Components: core
>    Affects Versions: 1.35.0, 1.36.0, 1.37.0
>            Reporter: Ruben Q L
>            Assignee: Ruben Q L
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.38.0
>
>
> The Javadoc in SqlStaticAggFunction#constant says:
> {noformat}
> GROUPING(deptno) expands to literal 1 if the aggregate has GROUP BY deptno
> {noformat}
> However, this "1" seems incorrect (it should rather be "0"). If we look at 
> the actual implementation of this logic in 
> [SqlGroupingFunction#constant|https://github.com/apache/calcite/blob/e4bbcd6f53ff6be2e2be0893b94d3806e58278d2/core/src/main/java/org/apache/calcite/sql/fun/SqlGroupingFunction.java#L62],
>  or [this test 
> agg.iq|https://github.com/apache/calcite/blob/e4bbcd6f53ff6be2e2be0893b94d3806e58278d2/core/src/test/resources/sql/agg.iq#L689],
>  it seems in these cases the GROUPING is expanded to a constant 0.



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

Reply via email to