[WIP] fix: allow chaining with fixed-length patterns #771
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR removes the limitation from a fixed-length pattern. It should work with chaining with other patterns such as:
(u)-[*2]->(v);(v)-[]->(k),(u)-[]->(v);(v)-[*2]->(k);(a)-[*1]->(b);(b)-[*2]->(c);(c)-[*3]->(d)Why are the changes needed?
The current version cannot parse a chained pattern when it is with a fixed-length pattern.
Error:
Expected:
How does it work?
The fixed-length vertex generation logic is moved to the query rewrite phase. The naming rule for generating interim vertexes has changed from
_v1,_v2,_v3to_uv1,_uv2,_uv3, where the names are derived by combining the source and target vertex namesuandv. This behavior change is inevitable to prevent duplication. For example, in the pattern(b)-[*2]->(c);(c)-[*3]->(d)_v1should not be generated twice, as it would result in duplicated column name. Instead,_bcand_cdwill be generated.Before: Parser
After: Pattern Rewrite