private Collection coalesceOrderedResults(Collection<Collection> results,
      ExecutionContext context, CompiledSelect cs, int limit) {
    List<Collection> sortedResults = new ArrayList<>(results.size());
    // TODO :Asif : Deal with UNDEFINED
    for (Object o : results) {
      if (o instanceof Collection) {
        sortedResults.add((Collection) o);
      }
    }

    return new NWayMergeResults(sortedResults, cs.isDistinct(), limit, cs.getOrderByAttrs(),
        context, cs.getElementTypeForOrderByQueries());

  }
Executes a pre-compiled query on a data store. Adds result objects to resultQueue

@return boolean true if the result is a struct type
@throws ForceReattemptException if query should be tried again
geode-core/src/main/java/org/apache/geode/internal/cache/PRQueryProcessor.java