Skip to content

Include all nodes of a path during mapping. #2114

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

Closed
Jafeyyu opened this issue Jan 14, 2021 · 4 comments
Closed

Include all nodes of a path during mapping. #2114

Jafeyyu opened this issue Jan 14, 2021 · 4 comments
Assignees
Labels
type: bug A general bug

Comments

@Jafeyyu
Copy link

Jafeyyu commented Jan 14, 2021

Stream.of(allValues.get(Constants.PATH_START).asNode(), allValues.get(Constants.PATH_START).asNode())

The Nodes of Path need to filter should be PATH_START and PATH_END,but there is PATH_START and PATH_START

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 14, 2021
@michael-simons
Copy link
Collaborator

🤦 Oh dear.

Thank you so much.

@michael-simons michael-simons self-assigned this Jan 14, 2021
@michael-simons michael-simons added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 14, 2021
@michael-simons michael-simons added this to the 6.0.4 (2020.0.4) milestone Jan 14, 2021
@michael-simons michael-simons changed the title The Nodes of Path need to filter should be PATH_START and PATH_END Include all nodes of a path during mapping. Jan 14, 2021
@michael-simons
Copy link
Collaborator

There are a couple of scenarios where not all nodes or not all relationships of a path have been included in the mapping. First of call we filtered on the wrong path segment as documented by @Jafeyyu in this ticket and in some scenarios the synthesization of values did not include the segments in such a way that everything in the result was actually used in the mapping.

This is fixed by synthesizing a result that has the form as a custom query (root node, all relationships and all related nodes), instead of going through the paths.

michael-simons added a commit that referenced this issue Jan 14, 2021
This changes the logic of path mapping. We now synthesize a result that has the form as a custom query would have (root node, all relationships and all related nodes), instead of going through the paths. This simplifies the entity converter by a magnitude.

Thus, we automatically include all nodes of a given type when we are not interested in the relation in a query like
`MATCH p=()-[:IS_SIBLING_OF]-> () RETURN p`, include the last node in the path as an related object, are independent of both the direction that has been used for querying when filling in relationships and also have the same results regardless whether the paths is odd or even numbered.

This fixes #2114.
@Jafeyyu
Copy link
Author

Jafeyyu commented Jan 14, 2021

I think you are right, I thought so before, but I don't know how to describe it, because my English is not very good, because of this problem, I put the version at 5.6.3 in my project,Thank you for fixed it.

@michael-simons
Copy link
Collaborator

No worries, your contribution is appreciated, I wouldn't have the issue so soon without it. Take care!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants