Version 2.6.6 of the Java SDK.
When QueryIterator is used with RANDOM_SAMPLE (seems like a common use case), all pages after the first get dropped with a message like this:
ERROR io.milvus.v2.utils.RpcUtils -- QueryRequest collectionName:radiology_cases failed, error code: 2, reason: failed to create query plan: cannot parse expression: ( RANDOM_SAMPLE(0.01773489873372823) ) and caseId > "cmg7ztvn32flo0764x2jg7tgo", error: random sample expression can only be the last expression in the logical and expression: invalid parameter
This is caused because QueryIterator.setupNextExpr() constructs a query that will be invalid if the oiriginal query uses RANDOM_SAMPLE, since if it is present it seemingly must be alone or the last component of a top-level conjunction.
It may be enough to change
return " ( "+currentExpr+" ) " + " and " + filteredPKStr;
to
return filteredPKStr + " and ( "+currentExpr+" ) ";
I will give this a try and submit a PR if it works.