MODE-1900 - Fixed retrieving DISTINCT JOIN result by removing the code around "locationStartIndexInTuple". The old code assumed that locations in tuples are found at consecutive indexes, which isn't true in this case. The fix uses the selector names and for each selector, retrieves the index of the location and then the location itself.
MODE-1900 - Added small code optimization, as per review.