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

treat zero length traversals as variable length traversals #483

Merged
merged 5 commits into from
Oct 29, 2023

Conversation

swilly22
Copy link
Contributor

Resolves #478

Queries such as:

MATCH (a)-[*0]->(b) RETURN a, b

Treat the zero length edge as a variable length edge of length 0.
By doing so the pattern is matched by the Conditional Variable Length Traverse operation, matching only the source node.

@swilly22 swilly22 requested a review from AviAvni October 29, 2023 12:13
@@ -70,12 +70,19 @@ QGEdge *QGEdge_Clone
return e;
}

// returns true if edge represents a variable length path
// e.g. ()-[*]->()
// note: a zero length edge: ()-[*0]->() is considered a variable length edge
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would like to treat zero length edges as variable length edges, this way our var-len traversal will be used and only the source node will be matched.

@swilly22 swilly22 merged commit a19095a into master Oct 29, 2023
8 checks passed
@swilly22 swilly22 deleted the zero-length-traversal branch October 29, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when MATCH path of length 0
2 participants