private void mapOrderByColumns(ExecutionContext context)
      throws TypeMismatchException, NameResolutionException {
    if (orderByAttrs != null) {
      for (final CompiledSortCriterion csc : orderByAttrs) {
        // Ideally for replicated regions, the requirement that
        // projected columns should
        // contain order by fields ( directly or derivable on it),
        // is not needed. But for PR , the query gathers only projected
        // columns, so applying order by on the query node
        // will need order by values ( which we dont send). So this
        // restriction is needed.
        // Also if this restriction is assumed to be correct, then the order
        // by comparator can be optimized as
        // it does not need to keep the mapping of evaluated order by clause,
        // for comparison
        if (!csc.mapExpressionToProjectionField(projAttrs, context)) {
          hasUnmappedOrderByCols = true;
        }
      }
    }
  }
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