Hi @Guglielmo , I haven’t tried looking at the suggestions that the AI assistant will make for java snippets, but the code won’t work because unfortunately this is not the way java snippets work.
Take a look at the first 5 paragraphs of the following post which apply equally here, and gives some background about why it won’t work…
The java snippet can only process a single row at a time and is called once for each row in the dataset, sequentially.
A java snippet therefore cannot access all rows at the same time in a single invocation. It cannot sort the rows and it is not capable of either increasing the number of rows or reducing the number of rows in the resultant dataset.
It is a powerful node but not suitable for the type of operations you are trying to perform. The python nodes, on the other hand, can do all those things. I hope that helps.
There are some things that it can do though to assist with cumulative calculations though… See