TUDB-Labs / TuDB

A distributed graph database system (GDBMS)
https://tudb-labs.github.io/TuDB/
Apache License 2.0
8 stars 1 forks source link

Fixed logical errors in the default method of expand path #366

Closed LianxinGao closed 1 year ago

LianxinGao commented 1 year ago

What changes were proposed in this pull request?

  1. Fix wrong expect results (verified on Neo4j).

  2. Create relationship must specify relationship type.

  3. Incoming direction reverse the pathTriple's start node and end node, so expand path should filter the start node.

  4. Both directions should determine whether the last node of the previous path and the last node of the next path are not equal, because they have a redundant relationship. For example: match (a)-[r]-(b), we will get (a)-[r]-(b) and (b)-[r]-(a), so patten like: match (a)-[r1]-(b)-[r2]-(c), we will first query relationship (a)-[r1]-(b), then expand from b. Expand from b we will get (b)-[r2]-(c) or (c)-[r2]-(b), finally we will get (a)-[r1]-(b)-[r2]-(c) or (a)-[r1]-(b)-[r2]-(b).

Why are the changes needed?

as title

Does this PR introduce any user-facing change?

No

How was this patch tested?

test passed.