You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/06/06 14:34:00 UTC

[jira] [Updated] (CALCITE-7590) Improve error message for window functions missing OVER clause to include function name

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

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

> Improve error message for window functions missing OVER clause to include function name
> ---------------------------------------------------------------------------------------
>
>                 Key: CALCITE-7590
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7590
>             Project: Calcite
>          Issue Type: Improvement
>    Affects Versions: 1.42.0
>            Reporter: Zhen Chen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.43.0
>
>
> Currently, when a window function is used without an OVER clause, Calcite reports a generic error message:
> "OVER clause is necessary for window functions"
> This message doesn't tell users which function is missing the OVER clause, which can be confusing when a query contains multiple window functions or when the error occurs in complex queries.
> Example query:
> SELECT rank(), row_number() OVER (ORDER BY id) FROM emp
> Current error message:
> "OVER clause is necessary for window functions"
> This change improves the error message to include the function name:
> "window function RANK requires an OVER clause"
> This makes it immediately clear which function needs to be fixed and it behaves consistently with PostgreSQL, improving the developer experience and reducing debugging time.
> Changes:
> - Added new resource message: absentOverClauseWithFunctionName
> - Updated SqlAggFunction and SqlValidatorImpl to use the new message format
> - Updated all related tests in SqlValidatorTest



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