I am using concat
, as explained here — Union + current syntax — a problem I’m having is that it does return duplicate records. Ideally we would get the union of records as a set (no duplicates).
Thanks for the help.
I am using concat
, as explained here — Union + current syntax — a problem I’m having is that it does return duplicate records. Ideally we would get the union of records as a set (no duplicates).
Thanks for the help.
Right, the techniques in Union + current syntax will chain multiple Sets end-to-end rather than interlace them together.
There is a .distinct()
method for Sets. It will scan the entire Set to produce results, so you don’t typically want to use .distinct()
with pagination. Instead, you might consider using .toArray()
along with it. E.g. set1.concat(set2).distinct().toArray()
If the Set is indeed large enough that pagination is required, then you may need to deduplicate results in your client application.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.