fix(cypher): preserve node properties through WITH aggregation#465
Open
KerseyFabrications wants to merge 1 commit into
Open
fix(cypher): preserve node properties through WITH aggregation#465KerseyFabrications wants to merge 1 commit into
KerseyFabrications wants to merge 1 commit into
Conversation
A node group variable carried through a WITH aggregation (e.g. `WITH g, count(*) AS c RETURN g.file_path`) returned blank for every property except its name: the carried virtual binding held only the group key (the node's name) and lacked a store handle, so node_prop() could neither read other fields nor compute degrees. Fix: capture the node id of a bare node group-var in with_agg_find_or_create and tag the carried virtual binding with it; in node_prop(), when such a stub (id set, string fields unpopulated) is asked for a missing property, re-fetch the full node via cbm_store_find_node_by_id and project it. Also propagate the store onto virtual bindings so node_prop can re-fetch and compute degrees. The stub gate is heuristic but never yields a wrong value — worst case is one redundant indexed lookup. Adds regression test cypher_exec_with_node_groupvar_prop. Signed-off-by: Kris Kersey <kris@kerseyfabrications.com>
2bf474a to
8b03974
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A node group variable carried through a WITH aggregation
(e.g.
WITH g, count(*) AS c RETURN g.file_path) returned blank for everyproperty except its name: the carried virtual binding held only the group
key (the node's name) and lacked a store handle, so node_prop() could
neither read other fields nor compute degrees.
Fix: capture the node id of a bare node group-var in with_agg_find_or_create
and tag the carried virtual binding with it; in node_prop(), when such a stub
(id set, string fields unpopulated) is asked for a missing property, re-fetch
the full node via cbm_store_find_node_by_id and project it. Also propagate
the store onto virtual bindings so node_prop can re-fetch and compute
degrees. The stub gate is heuristic but never yields a wrong value — worst
case is one redundant indexed lookup. Adds regression test
cypher_exec_with_node_groupvar_prop.
Signed-off-by: Kris Kersey kris@kerseyfabrications.com