Skip to content

UNWIND $batch MATCH ... CREATE edge fails unless WHERE clause is used explicitly #3612

@KwonSunJae

Description

@KwonSunJae

ArcadeDB version: latest (Docker arcadedata/arcadedb:latest)
Protocol: Bolt (Cypher)

Rleated: #3139

Description

When performing bulk edge insertion using UNWIND + MATCH + CREATE, the following pattern fails silently or errors out:

UNWIND $batch AS e
MATCH (a:Person {id: e.src_id}), (b:Person {id: e.dst_id})
CREATE (a)-[:KNOWS {weight: e.weight, since: e.since}]->(b)

However, rewriting the same query with explicit WHERE clauses works correctly:

UNWIND $batch AS e
MATCH (a:Person)
WHERE a.id = e.src_id
MATCH (b:Person)
WHERE b.id = e.dst_id
CREATE (a)-[:KNOWS {weight: e.weight, since: e.since}]->(b)

These two forms should be semantically equivalent in openCypher. The inline property filter {id: e.src_id} should behave identically to WHERE a.id = e.src_id.

Expected behavior

Both query forms should produce the same result — matching nodes by indexed property and creating edges in bulk.

Actual behavior

The inline property filter form (MATCH (a:Person {id: e.src_id})) fails when the value references an UNWIND variable, while the WHERE form works.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions