GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — List subscript with an inline aggregate index may return null · Issue #4100 · ArcadeData/arcadedb

List subscript with an inline aggregate index may return null #4100

New issue
Copy link
New issue
Copy link
Closed
Bug
Closed
List subscript with an inline aggregate index may return null#4100
Bug
Copy link
Assignees
lvca
Labels
opencypher
Milestone
26.5.1

Description

@Silence6666668
Silence6666668
opened on May 6, 2026
Issue body actions

ArcadeDB version
Observed on Docker images:

  • arcadedata/arcadedb:latest
  • 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 return null when a list subscript uses an inline aggregate expression as the index, even though:

  • the same aggregate expression evaluates correctly on its own
  • the same list subscript works when the index is first materialized in WITH

In the minimized repro below, Neo4j returns the first score (85).
ArcadeDB returns null.

To Reproduce

Setup:

CREATE (:Person {name:'Alice', scores:[85,92,78]});

Query:

MATCH (p:Person {name:'Alice'})
OPTIONAL MATCH (p)-[:HAS_FRIEND]->(f:Person)
WITH p, collect(f) AS friends
RETURN p AS person,
       p.scores[toInteger(avg(size(friends)))] AS selectedScore;

Expected behavior
With no matching HAS_FRIEND relationships:

  • collect(f) becomes []
  • size(friends) is 0
  • avg(size(friends)) is 0
  • toInteger(...) is 0

So the query should return the first score:

85

Observed Neo4j result:

(:Person {name: "Alice", scores: [85, 92, 78]}), 85

Actual behavior
ArcadeDB returns the person correctly, but selectedScore becomes null:

(:Person {name: "Alice", scores: [85, 92, 78]}), null

Control query 1
If the same index is computed first and then reused, ArcadeDB behaves correctly:

MATCH (p:Person {name:'Alice'})
OPTIONAL MATCH (p)-[:HAS_FRIEND]->(f:Person)
WITH p, collect(f) AS friends
WITH p, toInteger(avg(size(friends))) AS idx
RETURN p AS person,
       p.scores[idx] AS selectedScore,
       idx;

Observed result on both Neo4j and ArcadeDB:

(:Person {name: "Alice", scores: [85, 92, 78]}), 85, 0

So the aggregate expression itself is not the problem.

Control query 2
If the subscript uses a non-aggregate index, ArcadeDB also behaves correctly:

MATCH (p:Person {name:'Alice'})
OPTIONAL MATCH (p)-[:HAS_FRIEND]->(f:Person)
WITH p, collect(f) AS friends
RETURN p AS person,
       p.scores[size(friends)] AS selectedScore;

Observed result on both Neo4j and ArcadeDB:

(:Person {name: "Alice", scores: [85, 92, 78]}), 85

This makes the boundary clearer: the failure is tied to using the aggregate expression inline inside the list subscript.

Activity

  1. robfrank
    self-assigned this
    on May 6, 2026
  2. robfrank
    added this to the 26.5.1 milestone on May 6, 2026
  3. lvca
    assigned
    lvca
    and unassigned
    robfrank
    on May 6, 2026
  4. lvca
    added the
    Bug
    issue type on May 6, 2026
  5. lvca
    added a commit that references this issue on May 6, 2026

    fix: Cypher mixed issues

    f353edf
  6. lvca commented on May 6, 2026

    @lvca
    lvca
    on May 6, 2026
    Member
    More actions

    Fixed.

  7. lvca
    closed this as completedon May 6, 2026
  8. tae898
    added a commit that references this issue on May 10, 2026

    fix: Cypher mixed issues

    6401964
  9. robfrank
    added
    opencypher
    on May 10, 2026
  10. robfrank
    added a commit that references this issue on May 12, 2026

    fix: Cypher mixed issues

    7d74feb
  11. tae898
    added 2 commits that reference this issue on Jun 28, 2026

    chore(deps): bump com.google.api.grpc:proto-google-common-protos from…

    4d0c0e2

    fix: Cypher mixed issues

    dbf9e94
  12. mergify
    added a commit that references this issue on Jul 8, 2026

    chore(deps): bump org.postgresql:postgresql from 42.7.12 to 42.7.13 […

    9b28abe
  13. lvca
    added a commit that references this issue on Aug 18, 2026

    fix(#6353, #6354): a range beheaded or reversed is still a range, and…

    90b0959
  14. lvca
    added 2 commits that reference this issue on Nov 16, 2026

    fix(#11764,#12154,#12316): address review - exact grouping keys, post…

    df6f367

    fix(#11764,#12154,#12316,#12327): openCypher label writes keep bindin…

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

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

opencypher

Type

Bug

Projects

No projects

    Milestone

    • 26.5.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.