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

Pattern filter causes wrong result in MATCH #4792

Closed
Aiee opened this issue Oct 27, 2022 · 0 comments · Fixed by #4813
Closed

Pattern filter causes wrong result in MATCH #4792

Aiee opened this issue Oct 27, 2022 · 0 comments · Fixed by #4813
Assignees
Labels
severity/major Severity of bug type/bug Type: something is unexpected
Milestone

Comments

@Aiee
Copy link
Contributor

Aiee commented Oct 27, 2022

This issue is transferred from the comment section of #4760

besides, filter by path pattern will make size(pattern) behave abnormaly, when the path patern filter exists, the size((v)-->()) return a BAD_TYPE error,

(root@nebula) [nba]> match p = (v)-[e]->(t) where   id(v) == "Tim Duncan" and not (v)-[e]->(t:team)   return  v, size((v)-->()), (v)-->()
+---+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
| v | size((v)-->() = (v)-->()) | (v)-->() = (v)-->()                                                                                                                  |
+---+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
|   | BAD_TYPE                  | ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
|   | BAD_TYPE                  | ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
|   | BAD_TYPE                  | ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
|   | BAD_TYPE                  | ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
|   | BAD_TYPE                  | ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
|   | BAD_TYPE                  | ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
+---+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
Got 6 rows (time spent 3062/3497 us)

Thu, 20 Oct 2022 15:54:21 CST

(root@nebula) [nba]>

when we delete the path pater filte in the where clause, the result is correct:

(root@nebula) [nba]> match p = (v)-[e]->(t) where   id(v) == "Tim Duncan"   return  v, t, size((v)-->())
+--------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------+---------------------------+
| v                                                                                                                                    | t                                                                 | size((v)-->() = (v)-->()) |
+--------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------+---------------------------+
| ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) | ("Spurs" :team{name: "Spurs"})                                    | 7                         |
| ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) | ("LaMarcus Aldridge" :player{age: 33, name: "LaMarcus Aldridge"}) | 7                         |
| ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) | ("Tony Parker" :player{age: 36, name: "Tony Parker"})             | 7                         |
| ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) | ("Tony Parker" :player{age: 36, name: "Tony Parker"})             | 7                         |
| ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) | ("Danny Green" :player{age: 31, name: "Danny Green"})             | 7                         |
| ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"})         | 7                         |
| ("Tim Duncan" :t1{name: "hello world"} :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"})         | 7                         |
+--------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------+---------------------------+
Got 7 rows (time spent 2828/3397 us)

Thu, 20 Oct 2022 15:52:13 CST
@Aiee Aiee added the type/bug Type: something is unexpected label Oct 27, 2022
@Aiee Aiee added this to the v3.3.0 milestone Oct 27, 2022
@Aiee Aiee self-assigned this Oct 27, 2022
@Sophie-Xie Sophie-Xie modified the milestones: v3.3.0, v3.4.0 Oct 31, 2022
@jinyingsunny jinyingsunny added the severity/major Severity of bug label Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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