Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-29-2018 01:23 AM
Hi apoc community
Context:
Problem
I am playing around with the new apoc.custom.asProcedure functionality (a big thanks to @stefan.armbruster)
It works, registering a custom procedures was successful, same for calling the procedure.
First version of the procedure I have registered
CALL apoc.custom.asProcedure('treeitemlist',
substring(reduce(s="", x in [
'MATCH (z:C_tree_item)'
,'WHERE'
,'NOT z:T_tree_item_start'
,'AND z:T_tree_item_end' <-------THIS LINE CONTAINS THE ERROR . should have been: AND NOT z:....
,'WITH z order by z.line_index'
,'WITH collect(z) AS items'
,'RETURN items'
] | s+" "+x),1),'read',
[['items','LIST OF NODE']],[])
Unfortunately I made a mistake in my registered cypher statement (see source code above) when calling 'apoc.custom.asProcedure'.
I tried to fix it by calling again apoc.custom.asProcedure (see source code below), with the same procedure name but updated cypher statement. Still the registered procedure 'treeitemlist' is executed with the wrong cypher statement.
Next try to register procedure 'treeitemlist' with the correct cypher statement
CALL apoc.custom.asProcedure('treeitemlist',
substring(reduce(s="", x in [
'MATCH (z:C_tree_item)'
,'WHERE'
,'NOT z:T_tree_item_start'
,'AND NOT z:T_tree_item_end' <------THIS TIME THE STATEMENT IS CORRECT
,'WITH z order by z.line_index'
,'WITH collect(z) AS items'
,'RETURN items'
] | s+" "+x),1),'read',
[['items','LIST OF NODE']],[])
Seems that once a procedure is registered it is imposible to change the cypher statement. Is this correct?
That raises some more generic questions, but I will create a dedicated topic for them
Best
Markus
10-30-2018 03:58 AM
Can you try to execute the following statement before overriding the custom procedure :
call dbms.clearQueryCaches()
11-01-2018 03:52 AM
Hi Christophe
Here is what i tried today:
1:cleared the query caches as suggested
2: perform an override of the custom procedure,
3: call the custom function -> still old behavior.
3: Restart DBMS
4: call the custom function -> now it works, the custom functions behavior has changed
Probably some caching behavior within the DBMS, that still holds the hold cypher functions for the custom procedure.
And this behavior is reproducible. only after DBMS start the change of the cypher statement in the custom procedure become visible
Best
Markus
All the sessions of the conference are now available online