Skip to content

fix(cypher): preserve node properties through WITH aggregation#465

Open
KerseyFabrications wants to merge 1 commit into
DeusData:mainfrom
KerseyFabrications:fix/cypher-with-node-props
Open

fix(cypher): preserve node properties through WITH aggregation#465
KerseyFabrications wants to merge 1 commit into
DeusData:mainfrom
KerseyFabrications:fix/cypher-with-node-props

Conversation

@KerseyFabrications

Copy link
Copy Markdown

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

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>
@KerseyFabrications KerseyFabrications force-pushed the fix/cypher-with-node-props branch from 2bf474a to 8b03974 Compare June 14, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant