Skip to content

Call gds.bridges.* leads to NullPointerException when leaving out "remainingSizes" #354

Open
@JohT

Description

@JohT

Describe the bug

CALL gds.bridges.stream('name') YIELD from, to without the field remainingSizes leads to the following error message:

{
  "code": "Neo.ClientError.Procedure.ProcedureCallFailed",
  "message": "Failed to invoke procedure `gds.bridges.stream`: Caused by: java.lang.NullPointerException: Cannot load from long array because the return value of \"org.neo4j.gds.bridges.Bridge.remainingSizes()\" is null"
}

The error also occurs with the write method. Adding the field remainingSizes in the YIELD statement fixes the issue (as a workaround).

To Reproduce

  • GDS version: 2.15.0 (and 2.16.0)
  • Neo4j version: 2025.02.0 and 2025.03.0
  • Operating system: Neo4j Sandbox (and Mac OS Sonoma local)

Steps to reproduce the behavior

  • Create a (free) sandbox.neo4j.com

  • Use the basic "Graph Data Science" template

  • Create an undirected projection like this:

    CALL gds.graph.project(
        'airport-projection',
        'Airport',
        {
            HAS_ROUTE: {
                orientation: 'UNDIRECTED'
            }
        },
        {
            relationshipProperties: ['distance'],
            nodeProperties: ['altitude', 'runways', 'longest']
        }
    )
     YIELD graphName, nodeCount, relationshipCount
    RETURN graphName, nodeCount, relationshipCount
  • Run the bridges algorithm:

    CALL gds.bridges.stream('airport-projection') YIELD from, to

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions