asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Lychagin (Jira)" <j...@apache.org>
Subject [jira] [Resolved] (ASTERIXDB-2917) Incorrect result with group by and cross product
Date Wed, 30 Jun 2021 01:25:00 GMT

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

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

> Incorrect result with group by and cross product
> ------------------------------------------------
>
>                 Key: ASTERIXDB-2917
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2917
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: COMP - Compiler
>            Reporter: Dmitry Lychagin
>            Assignee: Dmitry Lychagin
>            Priority: Major
>             Fix For: 0.9.7
>
>
> The following query returns incorrect result: 
> {noformat}
> create dataset t1(id integer not unknown) open type primary key id;
> create dataset t2(id integer not unknown) open type primary key id;
> insert into t1 ([
>   { "id": 1, "x": "a" },
>   { "id": 2, "x": "a" },
>   { "id": 3, "x": "a" },
>   { "id": 4, "x": "b" },
>   { "id": 5, "x": "b" },
>   { "id": 6, "x": "b" }
> ]);
> insert into t2 ([
>   { "id": 11, "y": "c" },
>   { "id": 12, "y": "c" }
> ]);
> select t1.x, count(*) as cnt
> from t2, t1
> group by t1.x
> order by t1.x;
> {noformat}
> Expected result:
> {noformat}
> { "cnt": 6, "x": "a" }
> { "cnt": 6, "x": "b" }
> {noformat}
> Actual (incorrect) result
> {noformat}
> { "cnt": 3, "x": "a" }
> { "cnt": 3, "x": "a" }
> { "cnt": 3, "x": "b" }
> { "cnt": 3, "x": "b" }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message