You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2024/05/23 13:02:00 UTC

[jira] [Updated] (CALCITE-6418) Expression with ALL aggregate return unexpected result.

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

Evgeny Stanilovsky updated CALCITE-6418:
----------------------------------------
    Description: 
I expect that:

{noformat}
SELECT i=ALL(SELECT i FROM (values(1), (null)) integers(i) WHERE i=i1.i OR i IS NULL) FROM (values(1), (2)) i1(i) ORDER BY i;
{noformat}
expect that will return:

{noformat}
null
null
{noformat}

or 

{noformat}
false
false
{noformat}
(standard defines only true|false) as a return result for EVERY aggregate

instead:


{noformat}
true
null
{noformat}

was observed.

  was:
I expect that:

{noformat}
SELECT i=ALL(SELECT i FROM (values(1), (null)) integers(i) WHERE i=i1.i OR i IS NULL) FROM (values(1), (2)) i1(i) ORDER BY i;
{noformat}
will return:

{noformat}
null
null
{noformat}

or 

{noformat}
false
false
{noformat}
(standard defines only true|false) as a return result for EVERY aggregate

instead:


{noformat}
true
null
{noformat}

was observed.


> Expression with ALL aggregate return  unexpected result.
> --------------------------------------------------------
>
>                 Key: CALCITE-6418
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6418
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.37.0
>            Reporter: Evgeny Stanilovsky
>            Priority: Major
>
> I expect that:
> {noformat}
> SELECT i=ALL(SELECT i FROM (values(1), (null)) integers(i) WHERE i=i1.i OR i IS NULL) FROM (values(1), (2)) i1(i) ORDER BY i;
> {noformat}
> expect that will return:
> {noformat}
> null
> null
> {noformat}
> or 
> {noformat}
> false
> false
> {noformat}
> (standard defines only true|false) as a return result for EVERY aggregate
> instead:
> {noformat}
> true
> null
> {noformat}
> was observed.



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