Skip to content

openCypher: parallel lightweight edges share one identity, so relationship uniqueness drops paths over them and id(r) of a light edge throws #9573

Closed

Description

@lvca

Two lightweight edges of the same type between the same two vertices (two parallel light self loops included) have one identity, LightEdgeRID(type, out, in), and the openCypher row pipeline uses that identity for relationship uniqueness. It therefore treats them as one relationship: a path that walks one of them and then the other is dropped as if it reused a relationship.

Found while working on #9283: the count push-downs, which count adjacency entries, give the openCypher answer, and the row pipeline does not.

Repro:

CREATE VERTEX TYPE P; CREATE EDGE TYPE K;
-- a.newLightEdge("K", a); a.newLightEdge("K", a); a.newEdge("K", b)
MATCH (a:P)-[:K]-(b:P)-[:K]-(c:P) WHERE a <> c RETURN count(*)            -- 4 (push-down, correct)
MATCH (a:P)-[:K]-(b:P)-[:K]-(c:P) WHERE a <> c WITH * RETURN count(*)     -- 2 (pipeline)

Counted by hand with each edge a relationship of its own: from a, (loop1, a->b) and (loop2, a->b); from b, (a->b, loop1) and (a->b, loop2): 4. Without the inequality, the pipeline answers 2 where the answer is 6.

Related: id(r) on a lightweight edge fails, Cannot encode RID #4:-1 as a numeric id(): position -1 does not fit the 47 bits reserved for positions, so MATCH (a)-[r:K]-(b) RETURN id(r) cannot be run at all once a light edge is in the pattern.

Both come from a light edge having no position of its own. A fix needs an identity that tells two parallel light edges apart within a query (for instance the edge-list entry they come from) for uniqueness, and a defined answer for id() of a light edge (null, or a synthetic value), instead of an exception.

Activity

  1. added this to the 26.11.1 milestone on Oct 9, 2026
  2. added
    engine
    on Oct 9, 2026
  3. added
    severity:minor
    on Oct 9, 2026
  4. added
    in progress
    on Oct 9, 2026
  5. self-assigned this
    on Oct 9, 2026
  6. added 7 commits that reference this issue on Oct 9, 2026
  7. lvca commented on Oct 9, 2026

    @lvca
    MemberAuthor

    Fixed in #9588 (26.11.1).

    Two lightweight edges of the same type between the same two vertices (including parallel self loops) are now separate relationships for Cypher relationship uniqueness, so a path can walk one and then the other, but never the same one twice. id() of a lightweight edge now returns null instead of failing, since it has no record to encode. The docs (lightweight edges, id()) are updated.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  8. removed
    in progress
    on Oct 9, 2026
  9. added 2 commits that reference this issue on Oct 11, 2026
  10. added 8 commits that reference this issue on Oct 21, 2026
  11. added a commit that references this issue on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugengineopencypherseverity:minor

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions