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?
This is definitely a bug.
I still don't understand in which cases,
but with some queries like yours,
"EXPLAIN customQuery" executed under the hood to verify the query,
log@<NUMBER> as a column, instead of
log, this cause the error.
I opened an issue for it, The apoc.custom.declareProcedure throws exception "Query results do not match requested output" with some queries · Issue #2605 · neo4j-contrib/neo4j-apoc-procedures · GitHub
Ok, perhaps I got it.
The bug happens because your query use the variable
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
match (node)-[:has]->(log:System:Log) where (node)-[:current]->(log) return log
match (node)-[:has]->(logAnother:System:Log) where (node)-[:current]->(logAnother) return logAnother
and the return output from