ArcadeDB version
- ArcadeDB version:26.4.1-SNAPSHOT
Observed on Docker image:
arcadedata/arcadedb:latest
Environment
- Docker on Windows host
- ArcadeDB queried through the HTTP API:
/api/v1/command/arcade
- Neo4j and Memgraph used as reference engines for comparison
Describe the bug
When UNWIND follows a WITH that carries rows forward from a previous MATCH, ArcadeDB may duplicate every expanded row by the size of the upstream row set.
In the minimized repro below, there are two input rows (Alice and Charlie).
Each of them is unwound across range(1, 3), so the expected result is 2 * 3 = 6 rows.
Neo4j and Memgraph both return 6 rows.
ArcadeDB returns 12 rows, with every logical row duplicated once.
To Reproduce
Setup
CREATE (:Person {name: 'Alice'}),
(:Person {name: 'Bob'}),
(:Person {name: 'Charlie'});
Query
MATCH (p:Person)
WITH p.name AS personName
WHERE personName <> 'Bob'
UNWIND range(1, 3) AS i
RETURN personName, i
ORDER BY personName, i;
Expected behavior
Two surviving input rows (Alice, Charlie) expanded by range(1, 3) should produce:
Alice, 1
Alice, 2
Alice, 3
Charlie, 1
Charlie, 2
Charlie, 3
That is 6 rows total.
Actual behavior
ArcadeDB returns 12 rows:
Alice, 1
Alice, 1
Alice, 2
Alice, 2
Alice, 3
Alice, 3
Charlie, 1
Charlie, 1
Charlie, 2
Charlie, 2
Charlie, 3
Charlie, 3
Each logical row is duplicated.
Control cases
Control 1, when the upstream MATCH produces only one row, the duplication disappears:
MATCH (p:Person {name: 'Alice'})
WITH p.name AS personName
UNWIND range(1, 3) AS i
RETURN personName, i
ORDER BY i;
Observed result on all engines:
Alice, 1
Alice, 2
Alice, 3
Control 2, without UNWIND, ArcadeDB also behaves correctly:
MATCH (p:Person)
WITH p.name AS personName
WHERE personName <> 'Bob'
RETURN personName
ORDER BY personName;
Observed result on all engines:
This suggests the issue is specifically tied to UNWIND after WITH, not to the initial MATCH or the filter itself.
ArcadeDB version
Observed on Docker image:
arcadedata/arcadedb:latestEnvironment
/api/v1/command/arcadeDescribe the bug
When
UNWINDfollows aWITHthat carries rows forward from a previousMATCH, ArcadeDB may duplicate every expanded row by the size of the upstream row set.In the minimized repro below, there are two input rows (
AliceandCharlie).Each of them is unwound across
range(1, 3), so the expected result is2 * 3 = 6rows.Neo4j and Memgraph both return 6 rows.
ArcadeDB returns 12 rows, with every logical row duplicated once.
To Reproduce
Setup
Query
Expected behavior
Two surviving input rows (
Alice,Charlie) expanded byrange(1, 3)should produce:That is 6 rows total.
Actual behavior
ArcadeDB returns 12 rows:
Each logical row is duplicated.
Control cases
Control 1, when the upstream
MATCHproduces only one row, the duplication disappears:Observed result on all engines:
Control 2, without
UNWIND, ArcadeDB also behaves correctly:Observed result on all engines:
This suggests the issue is specifically tied to
UNWINDafterWITH, not to the initialMATCHor the filter itself.