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

Match statement hanging edge problem #4510

Closed
czpmango opened this issue Aug 11, 2022 · 5 comments
Closed

Match statement hanging edge problem #4510

czpmango opened this issue Aug 11, 2022 · 5 comments
Labels
affects/none PR/issue: this bug affects none version. priority/low-pri Priority: low process/done Process of bug severity/none Severity of bug type/bug Type: something is unexpected wontfix Solution: this will not be worked on recently

Comments

@czpmango
Copy link
Contributor

czpmango commented Aug 11, 2022

Inconsistent handling of dangling edges leads to incorrect results.

Environments
nebula 3.x

How To Reproduce

(root@nebula) [nba]> insert edge like() values "Tim Duncan"->"emptyPoint":()
Execution succeeded (time spent 2049/2361 us)

(root@nebula) [nba]> go from "Tim Duncan" over like yield like._dst,$$.player.age
+-----------------+---------------+
| like._dst       | $$.player.age |
+-----------------+---------------+
| "Manu Ginobili" | 41            |
| "Tony Parker"   | 36            |
| "emptyPoint"    | __NULL__      |
+-----------------+---------------+
Got 3 rows (time spent 3504/3903 us)

(root@nebula) [nba]> match (v)-[:like]->(n) where id(v)=="Tim Duncan" return v
+-------------------------------------------------------------------------------------------------------------+
| v                                                                                                           |
+-------------------------------------------------------------------------------------------------------------+
| ("Tim Duncan" :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
| ("Tim Duncan" :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
+-------------------------------------------------------------------------------------------------------------+
Got 2 rows (time spent 5232/5640 us)

(root@nebula) [nba]> match (v)-[:like]->() where id(v)=="Tim Duncan" return v
+-------------------------------------------------------------------------------------------------------------+
| v                                                                                                           |
+-------------------------------------------------------------------------------------------------------------+
| ("Tim Duncan" :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
| ("Tim Duncan" :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
| ("Tim Duncan" :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"}) |
+-------------------------------------------------------------------------------------------------------------+
Got 3 rows (time spent 3606/4029 us)

Expected behavior
Query behave consistently for dangling edges.

@czpmango czpmango added the type/bug Type: something is unexpected label Aug 11, 2022
@Sophie-Xie Sophie-Xie added this to the v3.3.0 milestone Aug 11, 2022
@Sophie-Xie Sophie-Xie assigned czpmango and xtcyclist and unassigned czpmango Aug 12, 2022
@Sophie-Xie Sophie-Xie added wontfix Solution: this will not be worked on recently priority/low-pri Priority: low labels Aug 31, 2022
@Sophie-Xie Sophie-Xie added later Solution: this issue will be handle in later version and removed wontfix Solution: this will not be worked on recently labels Aug 31, 2022
@Sophie-Xie Sophie-Xie removed this from the v3.3.0 milestone Aug 31, 2022
@Sophie-Xie Sophie-Xie added wontfix Solution: this will not be worked on recently and removed later Solution: this issue will be handle in later version labels Aug 31, 2022
@Sophie-Xie
Copy link
Contributor

Discuss it offline: 3.x will not fix it.

@shanlai
Copy link

shanlai commented Sep 26, 2022

(root@nebula) [nba]> INSERT VERTEX player(name, age) VALUES "close_tagless_5":("close_tagless_5", 18),"close_tagless_6":("close_tagless_6", 18);
Execution succeeded (time spent 1627/70852 us)

(root@nebula) [nba]> INSERT EDGE follow () VALUES "close_tagless_5"->"close_tagless_6":()
Execution succeeded (time spent 1744/62764 us)

(root@nebula) [nba]> delete vertex "close_tagless_5"
Execution succeeded (time spent 2013/78905 us)

(root@nebula) [nba]> match (v)-[e:follow]->(v1) where id(v)=="close_tagless_5" return v,e
+---------------------+----------------------------------------------------------------------+
| v                   | e                                                                    |
+---------------------+----------------------------------------------------------------------+
| ("close_tagless_5") | [:follow "close_tagless_5"->"close_tagless_6" @0 {degree: __NULL__}] |
+---------------------+----------------------------------------------------------------------+
Got 1 rows (time spent 2640/64082 us)

(root@nebula) [nba]> match (v)<-[e:follow]-(v1) where id(v)=="close_tagless_6" return v,e
+---+---+
| v | e |
+---+---+
+---+---+
Empty set (time spent 2729/68645 us)

Expected behavior
Query behave consistently for dangling edges.

@wey-gu
Copy link
Contributor

wey-gu commented Oct 13, 2022

Shall we consider adding an option(like if vertex exists) in the insert edge to ensure the user won't introduce hanging edges unwillingly?

@MuYiYong

@HarrisChu HarrisChu added the process/fixed Process of bug label Dec 6, 2022
@github-actions github-actions bot added affects/none PR/issue: this bug affects none version. severity/none Severity of bug labels Dec 6, 2022
@czpmango
Copy link
Contributor Author

czpmango commented Dec 8, 2022

I don't have the context for your offline discussion. But IMHO, this issue should be reopened.
Another point to consider is that AppendVertices operator will bring some performance overhead when there is no need to get vertex properties.

@czpmango
Copy link
Contributor Author

czpmango commented Dec 8, 2022

In addition, it will cause correctness problems. For example, this optimizer rule called PushLimitDownScanAppendVerticesRule is not valid.

@HarrisChu HarrisChu added the process/done Process of bug label Jan 9, 2023
@github-actions github-actions bot removed the process/fixed Process of bug label Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/none PR/issue: this bug affects none version. priority/low-pri Priority: low process/done Process of bug severity/none Severity of bug type/bug Type: something is unexpected wontfix Solution: this will not be worked on recently
Projects
None yet
Development

No branches or pull requests

6 participants