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 2021/06/30 01:25:00 UTC
[jira] [Resolved] (ASTERIXDB-2917) Incorrect result with group by
and cross product
[ 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)