Apoc.refactor.categorize creates duplicated category nodes

I've been using apoc.refactor.categorize on Neo 3.5.6 and then Neo 3.5.12 on Windows and I'm getting inconsistent behavior with duplicated category nodes created. And sometimes I also get the below error message when running the procedure:


Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure apoc.refactor.categorize: Caused by: org.neo4j.kernel.DeadlockDetectedException: ForsetiClient[0] can't acquire ExclusiveLock{owner=ForsetiClient[8]} on NODE(4041), because holders of that lock are waiting for ForsetiClient[0]. Wait list:ExclusiveLock[ Client[8] waits for [0]]

Attached a screenshot of the results I'm getting with in grey the category nodes duplicated and in orange the original nodes some of them having a relationship to each duplicated and some not.

Hello! Yes, thanks for bubbling this up. We actually have a pull request open on the Github repository right to fix this issue (fixes #826: apoc.refactor.categorize duplicated categorization nodes by conker84 · Pull Request #1348 · neo4j-contrib/neo4j-apoc-procedures · GitHub). We hope to have it in the next release, which should be in about a week or two.

In short, this should be resolved soon! Let us know if you need anything else!