Skip to content

CALL subqueries that contain UNION ALL may keep only the first branch, dropping rows from later branches. #3958

@Silence6666668

Description

@Silence6666668

ArcadeDB version

Observed on Docker images:

  • arcadedata/arcadedb:latest
  • arcadedata/arcadedb:26.4.1-SNAPSHOT

Environment

  • Docker on Windows host
  • ArcadeDB queried through the HTTP API: /api/v1/command/arcade
  • Requests sent in the same shape used by ArcadeDB Studio:
    • language: opencypher
    • serializer: studio

Describe the bug

CALL subqueries that contain UNION ALL may keep only the first branch, dropping rows from later branches.

This can be reproduced without any graph data at all.

To Reproduce

Query

CALL () {
  RETURN 'Jane' AS name
  UNION ALL
  RETURN 'John' AS name
  UNION ALL
  RETURN 'Inception' AS name
}
RETURN name
ORDER BY name;

Expected behavior

All three subquery branches should contribute rows:

Inception
Jane
John

Actual behavior

ArcadeDB returns only:

Jane

So the second and third UNION ALL branches are dropped.

Control cases

Control 1, the same UNION ALL outside a CALL subquery behaves correctly on ArcadeDB:

RETURN 'Jane' AS name
UNION ALL
RETURN 'John' AS name
UNION ALL
RETURN 'Inception' AS name
ORDER BY name;

Observed result on both Neo4j and ArcadeDB:

Inception
Jane
John

Control 2, the same issue also reproduces when the branches use ordinary graph matches instead of constants:

CALL {
  MATCH (p:Person)
  RETURN p.name AS name
  UNION ALL
  MATCH (m:Movie)
  RETURN m.title AS name
}
RETURN name
ORDER BY name;

With a dataset containing Jane, John, and movie Inception, Neo4j returns all three rows, while ArcadeDB returns only the Person rows.

This suggests the issue is specifically tied to UNION ALL inside CALL, not to UNION ALL in general.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions