Skip to content

Relationship pattern with a variable property-constrained endpoint may match no rows #4188

Closed

Description

@Silence6666668

ArcadeDB version
Observed on Docker images:

  • arcadedata/arcadedb:26.3.2
  • arcadedata/arcadedb:26.4.1-SNAPSHOT
  • arcadedata/arcadedb:26.4.2

Environment

  • Host OS: Windows 10
  • Architecture: x86_64
  • Deployment: Docker
  • ArcadeDB endpoint: HTTP /api/v1/command/arcade
  • Request mode matches ArcadeDB Studio:
    • language: opencypher
    • serializer: studio
  • Differential comparison target: Neo4j Docker neo4j:latest

Describe the bug
ArcadeDB may silently match no rows when a relationship pattern ends at a property-constrained node whose property value comes from a variable.

In the minimized repro below, the graph clearly contains:

  • (:Person {name:'Alice'})-[:FRIEND]->(:Person {name:'Bob'})

Neo4j correctly matches that edge when the endpoint is written as:

(:Person {name: fName})

with fName = 'Bob'.

ArcadeDB accepts the query but returns 0 rows on every tested line.

This does not look like a general property-constrained endpoint problem:

  • the same pattern works if the endpoint uses a literal property value
  • the same query also works if the property check is moved out of the node pattern and into a later WHERE

So the failure is specifically tied to using a variable inside the endpoint property map of a relationship pattern.

To Reproduce

Setup:

CREATE (a:Person {name:'Alice'}),
       (b:Person {name:'Bob'}),
       (a)-[:FRIEND]->(b);

Query:

WITH 'Bob' AS fName
MATCH (p:Person)-[:FRIEND]->(:Person {name: fName})
RETURN p.name AS person
ORDER BY person;

Expected behavior
Observed Neo4j result:

Alice

ArcadeDB should return the same row.

Actual behavior
Observed ArcadeDB results on all tested versions:

0 rows

So the relationship pattern behaves as if the endpoint property-constrained node does not exist.

Control cases

If the same endpoint constraint is expressed with a literal inside the node pattern, ArcadeDB behaves correctly:

MATCH (p:Person)-[:FRIEND]->(:Person {name:'Bob'})
RETURN p.name AS person
ORDER BY person;

Observed result on Neo4j and all tested ArcadeDB versions:

Alice

If the same value is kept in a variable but the property check is moved into WHERE, ArcadeDB also behaves correctly:

WITH 'Bob' AS fName
MATCH (p:Person)-[:FRIEND]->(f:Person)
WHERE f.name = fName
RETURN p.name AS person
ORDER BY person;

Observed result on Neo4j and all tested ArcadeDB versions:

Alice

So the graph itself is fine and variable equality on the endpoint is fine.
The failure starts specifically when the variable is placed inside the endpoint node pattern:

(:Person {name: fName})

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions