Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: bad count result of cross shard outer join #12269

Closed
eseokoh opened this issue Feb 8, 2023 · 0 comments · Fixed by #12298
Closed

Bug Report: bad count result of cross shard outer join #12269

eseokoh opened this issue Feb 8, 2023 · 0 comments · Fixed by #12298

Comments

@eseokoh
Copy link

eseokoh commented Feb 8, 2023

Overview of the Issue

count of cross shard outer join shows incorrect result.

Reproduction Steps

  1. Deploy the following vschema:
{
  "sharded": true,
  "vindexes": {
    "hash": {
      "type": "xxhash"
    },
  "tables": {
    "x0": {
      "column_vindexes": [
        {
          "column": "a",
          "name": "xxhash"
        }
      ]
    },
    "x1": {
      "column_vindexes": [
        {
          "column": "c",
          "name": "xxhash"
        }
      ]
    }
  }
}
  1. Deploy the following schema:
create table x0(a int primary key, b int);
create table x1(c int primary key, b int);
insert into x0 (a, b) values (1, 11), (2, null), (3, 0);
insert into x1 (c, b) values (1, 11);
  1. Run Select:
select x0.a from x0 left outer join x1 on x0.b = x1.b;

+---+
| a |
+---+
| 1 |
| 2 |
| 3 |
+---+
3 rows in set (0.01 sec)

As you see, this is good, however the followings are bad.

select count(x0.a) from x0 left outer join x1 on x0.b = x1.b;
+-------------+
| count(x0.a) |
+-------------+
|           1 |
+-------------+
1 row in set (0.01 sec)
select count(*) from x0 left outer join x1 on x0.b = x1.b;

+----------+
| count(*) |
+----------+
|        1 |
+----------+
1 row in set (0.09 sec)

Binary Version

14.0.4

Operating System and Environment details

N/A

Log Fragments

N/A
@eseokoh eseokoh added Needs Triage This issue needs to be correctly labelled and triaged Type: Bug labels Feb 8, 2023
@harshit-gangal harshit-gangal added Component: Query Serving and removed Needs Triage This issue needs to be correctly labelled and triaged labels Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants