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

Incorrect result on edge list join query #5154

Closed
kikimo opened this issue Dec 29, 2022 · 4 comments · Fixed by #5160
Closed

Incorrect result on edge list join query #5154

kikimo opened this issue Dec 29, 2022 · 4 comments · Fixed by #5160
Assignees
Labels
affects/master PR/issue: this bug affects master version. find/automation process/done Process of bug severity/major Severity of bug type/bug Type: something is unexpected
Milestone

Comments

@kikimo
Copy link
Contributor

kikimo commented Dec 29, 2022

Please check the FAQ documentation before raising an issue

Describe the bug (required)

Look at the query below:

(root@nebula) [gdlancer]> match (v1)-[e*1..2]->(v2) where id(v1) in [6] match (v2)-[e*1..2]->(v1) return count(*)
+----------+
| count(*) |
+----------+
| 0        |
+----------+
Got 1 rows (time spent 2.736ms/16.574125ms)

Thu, 29 Dec 2022 14:03:49 CST

We can see that Nebula return no result, if we change the return clause into return size(e), it shows that there are 6 rows in the result:

(root@nebula) [gdlancer]> match (v1)-[e*1..2]->(v2) where id(v1) in [6] match (v2)-[e*1..2]->(v1) return size(e)
+---------+
| size(e) |
+---------+
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
+---------+
Got 6 rows (time spent 2.583ms/18.1315ms)

Thu, 29 Dec 2022 14:05:48 CST

in contrast the same query on the same dataset in Neo4j return 6 rows:

$ match (v1)-[e*1..2]->(v2) where v1.id in [6] match (v2)-[e*1..2]->(v1) return count(*)

╒══════════╕
│"count(*)"│
╞══════════╡
│6         │
└──────────┘

Your Environments (required)

  • OS: uname -a
  • Compiler: g++ --version or clang++ --version
  • CPU: lscpu
  • Commit id (e.g. a3ffc7d8) 967a8c9 (community edition)

How To Reproduce(required)

Steps to reproduce the behavior:

  1. Step 1
  2. Step 2
  3. Step 3

Expected behavior

Additional context

@kikimo kikimo added type/bug Type: something is unexpected severity/major Severity of bug find/automation affects/master PR/issue: this bug affects master version. labels Dec 29, 2022
@kikimo kikimo added this to the v3.4.0 milestone Dec 29, 2022
@kikimo kikimo changed the title Incorrect result on edge list joint query Incorrect result on edge list join query Dec 29, 2022
@xtcyclist
Copy link
Contributor

xtcyclist commented Dec 29, 2022

A bug from hash join.

@xtcyclist
Copy link
Contributor

xtcyclist commented Dec 29, 2022

There may be a bug from RemoveAppendVerticesBelowJoinRule.

@xtcyclist
Copy link
Contributor

xtcyclist commented Dec 29, 2022

(root@nebula) [test]> match (v1)-[e*1..2]->(v2) where id(v1) in [6] match (v2)-[e*1..2]->(v1) return size(e)
+---------+
| size(e) |
+---------+
| 1       |
| 1       |
| 1       |
| 1       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
+---------+
Got 16 rows (time spent 357346/357603 us)

Thu, 29 Dec 2022 20:57:58 CST

(root@nebula) [test]> match (v1)-[e*1..2]->(v2) where id(v1) in [6] match (v2)-[e*1..2]->(v1) return count(*)
+----------+
| count(*) |
+----------+
| 16       |
+----------+
Got 1 rows (time spent 297718/297931 us)

I'm not sure what happened. But the results are ok now. Probabaly fixed by some other PR.

@xtcyclist
Copy link
Contributor

xtcyclist commented Dec 29, 2022

Fixed by this PR: 373a847

@github-actions github-actions bot added the process/fixed Process of bug label Dec 29, 2022
@xtcyclist xtcyclist reopened this Dec 29, 2022
@github-actions github-actions bot removed the process/fixed Process of bug label Dec 29, 2022
@github-actions github-actions bot added the process/fixed Process of bug label Dec 30, 2022
@Hester-Gu Hester-Gu added the process/done Process of bug label Jan 13, 2023
@github-actions github-actions bot removed the process/fixed Process of bug label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/master PR/issue: this bug affects master version. find/automation process/done Process of bug severity/major Severity of bug type/bug Type: something is unexpected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants