Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-15-2022 09:31 AM
I'm trying to create procedure for a cypher script with apoc.custom.declareProcedure (same for the asProcedure pendant) and always receive the exception:
Failed to invoke procedure `apoc.custom.declareProcedure`: Caused by: java.lang.RuntimeException: Query results do not match requested output.
Here's my procedure: procedure.txt
And a corresponding cypher script cypher.txt, which works like a charm
I've also tried to change the output type to NODE? or ANY but nothing worked.
Can anybody have a look at it and help me out?
Kind regards,
Marc
03-04-2022 03:08 AM
This is definitely a bug.
I still don't understand in which cases,
but with some queries like yours,
the "EXPLAIN customQuery"
executed under the hood to verify the query,
returns log@<NUMBER>
as a column, instead of log
, this cause the error.
I opened an issue for it, apoc.custom.declareProcedure throws · Issue #2605 · neo4j-contrib/neo4j-apoc-procedures · GitHub
03-04-2022 03:53 AM
Ok, perhaps I got it.
The bug happens because your query use the variable log
twice,
so the "EXPLAIN query" return log with an id to distinguish it from the other.
As a temporary workaround, you could modify your query changing the final part
from match (node)-[:has]->(log:System:Log) where (node)-[:current]->(log) return log
to match (node)-[:has]->(logAnother:System:Log) where (node)-[:current]->(logAnother) return logAnother
and the return output from (log::NODE)
to (logAnother::NODE)
All the sessions of the conference are now available online