Don’t expect too much from Arjen. He did a great job building this OQL, but upkeeping bugfixes an feature requests is an unpaid voluntary task done in spare time. The same goes for most AppStore apps.
What is the better alternative: download the module and fix it yourself. Then create a pull-request to the github-repository. That way all Arjen needs to do is to check your solution or enhancement and redeploy the next version of the tool.
You might even get some credits or forum-points for it :-)
After some more digging, I think the problem is not so much the OQL module, but more a defect in Mendix core itself (unless the usage by the module is incorrect).
In executeOQL, the limit and offset is set on IRetrievalSchema:
IRetrievalSchema schema = Core.createRetrievalSchema();
schema.setOffset(offset);
schema.setAmount(amount);
request.setRetrievalSchema(schema);
However, this results in an incorrect query result:
Where the count gives me for example 598 results (which is correct), the query with offset 588, limit 12 should give me the final 10 results, but it doesn’t, as the result is empty (the first part of the union only contains 569 items, the second part 29).
If I bypass the schema amount/offset and concatenate the limit/offset to the original query, the results seem to be correct.
So can it be the schema only looks at the first part of the query and not the result of the union?