Skip to content

RETURN DISTINCT * may collapse multiple rows into one #4189

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 collapse multiple distinct rows into a single row under RETURN DISTINCT *.

In the minimized repro below, there are clearly two matched Person nodes.
Neo4j returns both rows.
ArcadeDB returns only one row.

This is not just a serialization difference in how nodes are displayed.
The row count itself is wrong.

To Reproduce

Setup:

CREATE (:Person {name:'Alice'}),
       (:Person {name:'Bob'});

Query:

MATCH (p:Person)
RETURN DISTINCT *;

Expected behavior
Observed Neo4j result:

Alice
Bob

ArcadeDB should also return two rows.

Actual behavior
Observed ArcadeDB result on all tested versions:

Alice

So one matched row disappears entirely under RETURN DISTINCT *.

Control cases

Without DISTINCT, ArcadeDB behaves correctly:

MATCH (p:Person)
RETURN *;

Observed result on Neo4j and all tested ArcadeDB versions:

Alice
Bob

If the variable is returned explicitly rather than through *, ArcadeDB also behaves correctly:

MATCH (p:Person)
RETURN DISTINCT p;

Observed result on Neo4j and all tested ArcadeDB versions:

Alice
Bob

The same behavior also reproduces after a trivial WITH:

MATCH (p:Person)
WITH p
RETURN DISTINCT *;

Observed results:

  • Neo4j: 2 rows
  • ArcadeDB latest / 26.3.2 / 26.4.1-SNAPSHOT / 26.4.2: 1 row

So the problem is not general DISTINCT, and it is not general star projection.
The bad behavior starts specifically at RETURN DISTINCT *.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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