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 unwind result #4974

Closed
nebula-bots opened this issue Dec 2, 2022 · 1 comment · Fixed by #4990
Closed

Incorrect unwind result #4974

nebula-bots opened this issue Dec 2, 2022 · 1 comment · Fixed by #4990
Assignees
Labels
affects/master PR/issue: this bug affects master version. auto-sync find/automation process/done Process of bug severity/major Severity of bug type/bug Type: something is unexpected
Milestone

Comments

@nebula-bots
Copy link
Contributor

Please check the FAQ documentation before raising an issue

Describe the bug (required)

Look at the query from nebula below:

(root@nebula) [gdlancer_index]> MATCH (v0)-[e0]->(v1)<-[e1]-(v2:Label_2) WHERE (id(v0) in [8, 22, 19, 13, 5, 7, 18, 20]) AND (v2.Label_2.Label_2_1_Bool) UNWIND e1.Rel_2_3_Bool AS ua0 RETURN COUNT(*)
+----------+
| COUNT(*) |
+----------+
| 0        |
+----------+
Got 1 rows (time spent 1.975ms/16.773042ms)

Tue, 22 Nov 2022 14:01:21 CST

In contrast the same query on same dataset in Neo4j resutn 8 rows:

$ MATCH (v0)-[e0]->(v1)<-[e1]-(v2:Label_2) WHERE (v0.id in [8, 22, 19, 13, 5, 7, 18, 20]) AND (v2.Label_2_1_Bool) UNWIND e1.Rel_2_3_Bool AS ua0 RETURN COUNT(*)

╒══════════╕
│"COUNT(*)"│
╞══════════╡
│8         │
└──────────┘

Look into the details, we found that if there are null values in e1.Rel_2_3_Bool Nebula will filter all result:

(root@nebula) [gdlancer_index]> MATCH (v0)-[e0]->(v1)<-[e1]-(v2:Label_2) WHERE (id(v0) in [8, 22, 19, 13, 5, 7, 18, 20]) AND (v2.Label_2.Label_2_1_Bool) return  e1.Rel_2_3_Bool
+-----------------+
| e1.Rel_2_3_Bool |
+-----------------+
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| true            |
| true            |
| true            |
| true            |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| false           |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| true            |
| true            |
| true            |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
| __NULL__        |
+-----------------+
Got 40 rows (time spent 2.06ms/15.527916ms)

Tue, 22 Nov 2022 14:08:58 CST

(root@nebula) [gdlancer_index]> MATCH (v0)-[e0]->(v1)<-[e1]-(v2:Label_2) WHERE (id(v0) in [8, 22, 19, 13, 5, 7, 18, 20]) AND (v2.Label_2.Label_2_1_Bool) and e1.Rel_2_3_Bool is not null UNWIND e1.Rel_2_3_Bool AS ua0 RETURN COUNT(*)
+----------+
| COUNT(*) |
+----------+
| 8        |
+----------+
Got 1 rows (time spent 2.494ms/15.922084ms)

Tue, 22 Nov 2022 14:09:05 CST

The expected behavior:

unwind should return the value of the expression itself when the expression is not a list, and filter out the null values

Your Environments (required)

How To Reproduce(required)

Steps to reproduce the behavior:

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

Expected behavior

Additional context

@nebula-bots nebula-bots added affects/master PR/issue: this bug affects master version. auto-sync feature/none find/automation severity/major Severity of bug type/bug Type: something is unexpected labels Dec 2, 2022
@xtcyclist xtcyclist self-assigned this Dec 2, 2022
@Sophie-Xie Sophie-Xie added this to the v3.4.0 milestone Dec 2, 2022
@xtcyclist
Copy link
Contributor

Some issues go wrong around unwind and count. Need to make sure they deliver consistent results. Working on this issue.

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. auto-sync 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