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

support MERGE SET #305

Merged
merged 4 commits into from
Jan 3, 2019
Merged

support MERGE SET #305

merged 4 commits into from
Jan 3, 2019

Conversation

swilly22
Copy link
Contributor

No description provided.


if(op->matched || op->created) return NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the matched part of this logic is not quite right, since it will cause only one entity to be updated:

$ redis-cli GRAPH.QUERY social "MATCH (a) WHERE a.age = 31 RETURN COUNT(a)"
1) 1) 1) "COUNT(a)"
   2) 1) "4.000000"
2) 1) "Query internal execution time: 0.277327 milliseconds"
$ redis-cli GRAPH.QUERY social "MERGE (a {age: 31}) SET a.newprop = 100"
1) (empty list or set)
2) 1) "Properties set: 1"
   2) "Query internal execution time: 0.107706 milliseconds"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to check if that's the expected behavior

Copy link
Contributor Author

@swilly22 swilly22 Jan 3, 2019

Choose a reason for hiding this comment

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

Indeed that's the case 👍

Copy link
Contributor

@jeffreylovitz jeffreylovitz left a comment

Choose a reason for hiding this comment

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

One comment not on updated files:
op_update.c:100
op_update.c:
100:
change from = to += so that the properties_set count created by MERGE doesn't get overwritten.

$ redis-cli GRAPH.QUERY social "MERGE (a:newlabel {name: 'ewweccwd'}) SET a.secondprop = 4"
1) (empty list or set)
2) 1) "Labels added: 1"
   2) "Nodes created: 1"
   3) "Properties set: 1"
   4) "Query internal execution time: 0.611405 milliseconds"

@swilly22 swilly22 merged commit a9f2c2a into master Jan 3, 2019
@swilly22 swilly22 deleted the merge-set branch January 3, 2019 11:54
pnxguide pushed a commit to CMU-SPEED/RedisGraph that referenced this pull request Mar 22, 2023
* support MERGE SET

* merge pass down multiple matches

* merge clause name anonymou nodes

* adding to resultset stats instead of overwriting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants