ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taras Ledkov (Jira)" <j...@apache.org>
Subject [jira] [Assigned] (IGNITE-14681) Calcite engine. Extend return type of sum() aggregate function
Date Wed, 02 Jun 2021 15:00:00 GMT

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

Taras Ledkov reassigned IGNITE-14681:

    Assignee: Taras Ledkov

> Calcite engine. Extend return type of sum() aggregate function
> --------------------------------------------------------------
>                 Key: IGNITE-14681
>                 URL: https://issues.apache.org/jira/browse/IGNITE-14681
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Aleksey Plekhanov
>            Assignee: Taras Ledkov
>            Priority: Major
> Currently, {{sum()}} aggregate function returns the same type as an argument and there
can be an overflow.
> For example, query:
> {noformat}
> SELECT SUM(i::SMALLINT) FROM (SELECT 32000 as i UNION ALL SELECT 32000){noformat}
> Returns {{-1536}}.
> Perhaps it would be better to return an extended type as some other vendors do.
> For example, PostgreSQL returns {{bigint}} for {{smallint}} or {{int}} arguments, {{numeric}}
for {{bigint}} arguments, {{double precision}} for floating-point arguments. MySQL returns
a {{DECIMAL}} value for exact-value arguments ({{INTEGER}} or {{DECIMAL}}), and a {{DOUBLE}}
value for approximate-value arguments ({{FLOAT}} or {{DOUBLE}})
> Affected tests:
> {{modules/calcite/src/test/sql/aggregate/aggregates/test_sum.test_ignore}}

This message was sent by Atlassian Jira

View raw message