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
3.0 Support REMOVE property in cost planner #6071
Conversation
IMHO it would be nicer to have a proper |
val result = updateWithBothPlanners("MATCH (n) REMOVE n.prop RETURN exists(n.prop) as still_there") | ||
|
||
//THEN | ||
assertStats(result, propertiesSet = 1) |
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.
We should probably rename this propertiesSet
parameter to propertiesWritten
or something, because this is a bit confusing.
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.
Curiously the stats did not have a propertiesRemoved counter, so as far as they were concerned removal was seen as a set-property. I took this has a hint! :-)
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.
Yes, I saw that too, and that's why I made this comment.
I agree with @pontusmelke, but implementation-wise I see that we can definitely reuse the runtime code (which we can not for labels, as they don't have this symmetry), and implement it as setting null, as long as the plan description in this case prints |
Regarding the discussion of having a real RemoveProperty or fake RemovePropery in the plan description, should we differentiate between the user typing |
I think it's perfectly reasonable to plan |
The problem is that this plan makes autoparameterization hide the remove. That seems unreasonable to me. Pontus approach of making REMOVE syntax have REMOVE plan, and SET syntax have SET plan is less confusing. But it is more code and hides the semantic equivalence. |
I think we should strive to have few and simple operators in our query plans. That makes it easier to build planners and runtimes working with these operators. So, in this case, I prefer a single operator that solves both problems. The ability of the user to recognise query parts in the logical plan is much less valuable, IMHO. |
Since SET n.prop = null is semantically equivalent to removing a property, we planned this as a rewrite to SetProperty in the ClauseConversion phase.
da13b5e
to
37014b6
Compare
Since SET n.prop = null is semantically equivalent to removing a property, we planned this as a rewrite to SetProperty in the ClauseConversion phase.