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
Support label creation via property values #1762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments.
Still have to get to the end if the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work 💪
@DavIvek can you please provide me with docs PR and release note? |
@kgolubic tomorrow 'll write docs and release notes for PRs I opened for 2.16 release |
@kgolubic I'm currently considering where to include this information in the documentation, but I'm unsure of the best location. Initially, I looked into the |
@DavIvek I would say this is the way to go. Can you take this over? |
@DavIvek are there any plans to implement the same for the edge type? |
@katarinasupe At the moment no, but it could be implemented in the future, did anyone asked for that? |
This does not work for me on the release candidate, I did get the following output:
|
Sorry @DavIvek, ignore my comment from above, so the following works. The issue was space before the label in the dataset :
We should maybe improve the messaging here @DavIvek? It was not clear to me what the issue is from the message: |
@antejavor I believe you'll encounter the same error message if you attempt to create a label with a null value or an integer, for instance. This error message isn't specific to this particular scenario, but I do agree that the messaging could be improved in these cases. |
My mistake, you won't encounter the same issue if you try to create a label with an integer; this will result in an error during the parsing phase. However, you will receive the same error message if you use parameters and provide a null or integer value (as the label must be a string type). This error will be detected during the evaluation phase when attempting to resolve the variable or parameter into a node label. |
Idea of this PR is to support queries that do label creation via property values.
For example:
This won't work for MERGE or MATCH clauses. Problem with these clauses is that we don't know what label we are using while we create a plan (since the evaluation phase comes after the planning phase ), hence we can't rewrite query plans to use indexes instead of scanning through all nodes. A possible approach could be to always use the ScanAll operator but that would be inefficient. For the same reason Memgraph doesn't support using property maps as parameters in MATCH/MERGE clauses.
SET and REMOVE clauses should also work.
[master < Task] PR
To keep docs changelog up to date, one more thing to do:
Release note:
User can create, set, or remove labels using property values, here is an example:
closes #1509