public SelectResults getEmptyResultSet(Object[] parameters, InternalCache cache, Query query)
      throws FunctionDomainException, TypeMismatchException, NameResolutionException,
      QueryInvocationTargetException {
    ExecutionContext context = new QueryExecutionContext(parameters, cache, query);
    computeDependencies(context);
    context.newScope((Integer) context.cacheGet(scopeID));
    context.pushExecCache((Integer) context.cacheGet(scopeID));
    SelectResults results = null;
    try {
      for (final Object iterator : iterators) {
        CompiledIteratorDef iterDef = (CompiledIteratorDef) iterator;
        RuntimeIterator rIter = iterDef.getRuntimeIterator(context);
        context.bindIterator(rIter);
      }
      results = prepareEmptyResultSet(context, false);
    } finally {
      context.popScope();
      context.popExecCache();
    }
    return results;
  }
Transforms the group by clause into distinct order by clause, if possible
geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledSelect.java