Skip to content

IllegalArgumentException when using apoc.cypher.runFirstColumn with a query that contains directed relationship #776

@johnymontana

Description

@johnymontana

Calling apoc.cypher.runFirstColumn with a query that contains a directed relationship the following error occurs:

Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke function `apoc.cypher.runFirstColumn`: Caused by: java.lang.IllegalArgumentException: Can not be converted to long: org.neo4j.kernel.impl.core.NodeProxy

To reproduce (using :play movies data):

MATCH (m:Movie)
RETURN apoc.cypher.runFirstColumn('WITH {m} AS m MATCH (m)<-[:ACTED_IN]-(:Person)-[:ACTED_IN]->(rec:Movie) RETURN rec LIMIT 10', {m:m}, true)

(results in error above)

Similar queries work fine however:

MATCH (m:Movie)
RETURN apoc.cypher.runFirstColumn('WITH {m} AS m RETURN m LIMIT 10', {m:m}, true)

(works fine)

MATCH (m:Movie)
RETURN apoc.cypher.runFirstColumn('WITH {m} AS m MATCH (m)-[:ACTED_IN]-(:Person)-[:ACTED_IN]-(rec:Movie) RETURN rec LIMIT 10', {m:m}, true)

(works fine)

The error seems to occur only when using directed relationships.

Metadata

Metadata

Assignees

No one assigned

    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