Create relationship must specify relationship type.
Incoming direction reverse the pathTriple's start node and end node, so expand path should filter the start node.
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).
What changes were proposed in this pull request?
Fix wrong expect results (verified on Neo4j).
Create relationship must specify relationship type.
Incoming direction reverse the pathTriple's start node and end node, so expand path should filter the start node.
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.