You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2024/06/01 01:38:00 UTC

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

    [ https://issues.apache.org/jira/browse/CALCITE-6418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17851238#comment-17851238 ] 

Julian Hyde commented on CALCITE-6418:
--------------------------------------

Do you intend to use {{ALL}} as a quantified comparison predicate (as added in CALCITE-1845) or as an aggregate function (as added in CALCITE-3815)?

You should check the plan and see which you are getting.

> 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)