You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Dmitry Lychagin (Jira)" <ji...@apache.org> on 2022/01/05 22:38:00 UTC

[jira] [Resolved] (ASTERIXDB-2696) Incorrect result with nested subplans

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

Dmitry Lychagin resolved ASTERIXDB-2696.
----------------------------------------
    Resolution: Fixed

> Incorrect result with nested subplans
> -------------------------------------
>
>                 Key: ASTERIXDB-2696
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2696
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: COMP - Compiler
>    Affects Versions: 0.9.4.1
>            Reporter: Dmitry Lychagin
>            Assignee: Dmitry Lychagin
>            Priority: Major
>             Fix For: 0.9.7
>
>
> The following query returns wrong result:
> {noformat}
> from [
>    { "a": 1, "b": [ 10, 20, 30] },
>    { "a": 1, "b": [ 40, 50, 60] },
>    { "a": 1, "b": [ 70, 80, 90] },
>    { "a": 2, "b": [ 100, 200, 300] },
>    { "a": 2, "b": [ 400, 500, 600] },
>    { "a": 2, "b": [ 700, 800, 900] }
> ] t
> group by a
> select a, sum( case when some x in b satisfies x >= 50 then 1 else 0 end) as s;
> {noformat}
> Current result:
> {noformat}
> { "a": 1, "s": 1 }
> { "a": 2, "s": 1 }
> {noformat}
> Correct result should be:
> {noformat}
> { "a": 1, "s": 2 }
> { "a": 2, "s": 3 }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)