You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cypher: a property with several values repeats rows, where openCypher's model has one value #2089
P3Backlog: valid, low payoff-per-effortarea:queryQuery execution, planning, fast paths, overlay, result formattingenhancementNew feature or requesttriage:needs-decisionBlocked on a product/design decision
openCypher has no multi-valued properties, so it never repeats a row for one. We do, because a property read joins every value of the property. #2006 kept today's rows on purpose (they match MATCH … WHERE) and pinned them, so a model change flips those tests deliberately rather than by accident. It changes results across the Cypher surface, so it needs a decision on the model before code.
What a property with several values does today:
WHERE gives the row once per value that passes: MATCH (p:P) WHERE p.age > 30 RETURN count(p) is 4 over three people when one of them has two ages above 30.
ORDER BY gives the row once per value; WITH DISTINCT keeps those copies (the sort key is projected with them), while RETURN DISTINCT removes them.
An aggregate in a later clause counts each copy.
A read inside an aggregate's argument (collect(p.age), avg(n.age)) is joined before grouping, so it repeats the group's rows for every aggregate of that clause: WITH p, count(f) AS c, collect(p.age) AS ages counts each friend once per age.
Decide the model. Matching openCypher means WHERE as a semi-join, a sort key of one value per row, and aggregate arguments read per row.
Implement it in the explicit-WITH and MATCH paths at once, so the two don't diverge.
P3Backlog: valid, low payoff-per-effortarea:queryQuery execution, planning, fast paths, overlay, result formattingenhancementNew feature or requesttriage:needs-decisionBlocked on a product/design decision
Activity