The PASS_DISTINCT_THROUGH query hint is ignored if the firstResult or maxResults query limiters are also used.
The cause is that the passDistinctThrough field of QueryParameters is not copied as part of the createCopyUsing method.
As a result, when QueryTranslatorImpl#list is invoked, and the hasLimit && containsCollectionFetches() clause is true, then the passDistinctThrough value of the original QueryParameters object is lost when createCopyUsing is called.
It's a one-line fix. Patch file attached.
would you mind supplying a quick and simple test case that outlines the problem to accompany the patch?
Used test case and fixed issue as indicated.