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] [Created] (ASTERIXDB-2917) Incorrect result with group by and cross product
Date Tue, 15 Jun 2021 22:04:00 GMT
Dmitry Lychagin created ASTERIXDB-2917:
------------------------------------------

             Summary: 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
             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