Repository navigation
Description
ArcadeDB version
Observed on Docker images:
arcadedata/arcadedb:26.3.2arcadedata/arcadedb:26.4.1-SNAPSHOTarcadedata/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: opencypherserializer: studio
- Differential comparison target: Neo4j Docker
neo4j:latest
Describe the bug
ArcadeDB may evaluate a node map projection incorrectly when one computed field is defined by a function call.
Instead of returning the projected map, ArcadeDB returns only the function result.
In the minimized repro below, Neo4j correctly returns:
{name: 'Alice', upperName: 'ALICE'}
ArcadeDB returns only:
ALICE
So the projection target p and the other projected fields disappear entirely.
This is not just a column-name issue.
Even with an explicit AS proj alias, the value itself is wrong.
To Reproduce
Setup:
CREATE (:Person {name:'Alice'});Query:
MATCH (p:Person)
RETURN p {.name, upperName: toUpper(p.name)} AS proj;Expected behavior
Observed Neo4j result:
{name: 'Alice', upperName: 'ALICE'}
ArcadeDB should return the same projected map.
Actual behavior
Observed ArcadeDB result on all tested versions:
ALICE
So the function result replaces the whole map projection.
Additional function-call variant
The same bad behavior also appears with size(...):
MATCH (p:Person)
WITH p, [] AS friends
RETURN p {.name, friendCount: size(friends)} AS proj;Observed results:
- Neo4j:
{name: 'Alice', friendCount: 0}
- ArcadeDB
latest / 26.3.2 / 26.4.1-SNAPSHOT / 26.4.2:
0
So this is not specific to one string function.
More generally, a computed field based on a function call can replace the entire projection result.
Control cases
A plain map projection without a computed field works:
MATCH (p:Person)
RETURN p {.name} AS proj;Observed result on Neo4j and all tested ArcadeDB versions:
{name: 'Alice'}
A computed field with a constant value also works:
MATCH (p:Person)
RETURN p {.name, friendCount: 0} AS proj;Observed result on Neo4j and all tested ArcadeDB versions:
{name: 'Alice', friendCount: 0}
A computed field with a non-function expression also works:
MATCH (p:Person)
RETURN p {.name, nameCopy: p.name + ''} AS proj;Observed result on Neo4j and all tested ArcadeDB versions:
{name: 'Alice', nameCopy: 'Alice'}
So the bad behavior is not about computed fields in general.
The failure starts when the computed field expression is a function call such as:
toUpper(p.name)size(friends)
Original differential seed
This family first resurfaced in the current feature-only random differential in a noisier path-and-list variant:
MATCH (p:Person)
OPTIONAL MATCH (p)-[:KNOWS|FRIEND*1..2]->(q:Person)
WITH p, collect(DISTINCT q) AS friends, [x IN [1, 2, 3] WHERE false | x] AS emptyList
RETURN p {.name, friendCount: size(friends), emptyList}
ORDER BY p.name;Observed results:
- Neo4j:
{name: 'Alice', friendCount: 0, emptyList: []}
{name: 'Bob', friendCount: 0, emptyList: []}
{name: 'Charlie', friendCount: 0, emptyList: []}
- ArcadeDB
26.4.2:
0
0
0
Direct minimization shows that the optional match and the extra empty-list field are not required.
The smaller root cause is the function-call computed field inside the map projection.
Activity
fix: [cypher] batch fixes for #4184, #4185, #4186, #4188, #4189 (#4196)
fix: [cypher] batch fixes for #4184, #4185, #4186, #4188, #4189 (#4196)
fix: [cypher] batch fixes for ArcadeData#4184, ArcadeData#4185, Arcad…