You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/06/30 00:12:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17371742#comment-17371742 ]
ASF subversion and git services commented on ASTERIXDB-2917:
------------------------------------------------------------
Commit 562fe20fede366b85f1507df9a962b2202248df6 in asterixdb's branch refs/heads/master from Dmitry Lychagin
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=562fe20 ]
[ASTERIXDB-2917][COMP] Incorrect result with group by over cross product
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- Fix incorrect result caused PushGroupByThroughProduct rule
- Add testcase
Change-Id: I85400289d3096c4da38ed73c7576e7c8b79a4909
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/12104
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>
Reviewed-by: Ali Alsuliman <al...@gmail.com>
> 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)