Hi Pablo,
java.lang.ClassCastException: org.basex.query.value.seq.tree.BigSeq cannot be cast to org.basex.query.value.item.Item
The reason for the exception was that you were creating a huge result in your query. The input value of $result was added multiple times, resulting in a much larger result:
function ($result) { for $id in async:ids() return if ... else $result }
After repeated calls of this function, the length of the $result sequence exceeded many billion items and eventually got negative (because our size counter is limited to 64 bits).
See the following simplified query:
hof:until( function ($result) { false() }, function ($result) { for $id in 1 to 100 return $result }, 'value' )
Or this one:
fold-left( 1 to 100, "value", function($seq, $curr) { ($seq, $seq) } )
As the error message was not very helpful, I have added a little range check [1, 2].
Hope this helps Christian
[1] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/ba... [2] http://files.basex.org/releases/latest/