[
https://issues.apache.org/jira/browse/CALCITE-6531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ruben Q L reassigned CALCITE-6531:
----------------------------------
Assignee: Ruben Q L
> 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
> 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)