Thanks.
Helped me a lot, found the bug in my code. Tested the new version and the error message is clearer. I don't know if its possible in case of java exception like this one to not only have the java stack trace but also the xquery one to be able to easier spot the line of code generating the error.
Have a nice day.
Pablo
On 15. 04. 16 10:23, Christian GrĂ¼n wrote:
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/