Error on cross join iterator


I’m doing a cross_join between two arrays and then I have to redimension the result.
Due to the application I have to do that on different source subarrays, so I’m using the between operation in order to preselect the arrays to be used inside the cross_join

redimension(cross_join(between(A1, coords1), between(A2, coords2), ...), ...)

It happens that some times (on certain data) the query returns

Error in file '/home/scidb/runtime/' near line 4
UserException in file: src/query/ops/cross_join/CrossJoinArray.cpp function: getItem line: 118
Error description: Error during query execution. No current element.

but not for all the inputs (A1 and A2 subarrays). And if I try to store the cross_join and then use the result for the redimension it works

store(cross_join(between(A1, coords1), between(A2, coords2), ...), CROSS);
redimension(CROSS, ...);

So, the query looks well done, because it works for most the times, and the the problem could not be in the source data because breaking the query it works. What could it be?


Hello! Thanks for telling us about this.

You should never see the LE_NO_CURRENT_ELEMENT error under normal circumstances. Most likely, you found a bug in SciDB.

What version of SciDB are you using?


I’m using the 15.7 version


I took a quick look through the bug records and this may have been fixed in 15.12. You can try it in 15.12 - if you can use an EC2 AMI, let me know and I can send you the AMI instructions to make it easier.

Another workaround that may help is to surround the betwen operator with _sg(… , 1, -1). For example, if the previous query was
cross_join( between (A, x0,x1), between(B, y0,y1), A.z, B.z)
then try this:
cross_join( _sg( between (A, x0,x1),1,-1), _sg( between(B, y0,y1),1,-1) A.z, B.z)

The _sg is a hidden operator, scatter/gather. Used this way, it forces the data to be materialized, so it will evaluate the between in a more typical, sequential fashion. It will probably be slower but may help the particular interaction you’re running into. Let me know how it goes.

If you’d like more information from us - let us know a little more as well. An array schema, and a data sample (if possible) that reproduces this would of course help a lot. Cheers.