public void select(Map<Integer, Object> queryComponents) {
    final CompiledValue limit;
    final Object limitObject = queryComponents.remove(OQLLexerTokenTypes.LIMIT);
    if (limitObject instanceof Integer) {
      limit = new CompiledLiteral(limitObject);
    } else {
      limit = (CompiledBindArgument) limitObject;
    }
    @SuppressWarnings("unchecked")
    final List<CompiledSortCriterion> orderByAttrs =
        (List<CompiledSortCriterion>) queryComponents.remove(OQLLexerTokenTypes.LITERAL_order);

    final List<?> iterators = (List<?>) queryComponents.remove(OQLLexerTokenTypes.LITERAL_from);
    @SuppressWarnings("unchecked")
    List<Object[]> projAttrs =
        (List<Object[]>) queryComponents.remove(OQLLexerTokenTypes.PROJECTION_ATTRS);
    if (projAttrs == null) {
      // remove any * or all attribute
      queryComponents.remove(OQLLexerTokenTypes.TOK_STAR);
      queryComponents.remove(OQLLexerTokenTypes.LITERAL_all);
    }

    // "DISTINCT" or null
    final String distinct = (String) queryComponents.remove(OQLLexerTokenTypes.LITERAL_distinct);
    @SuppressWarnings("unchecked")
    final List<String> hints =
        (List<String>) queryComponents.remove(OQLLexerTokenTypes.LITERAL_hint);

    @SuppressWarnings("unchecked")
    final List<CompiledValue> groupByClause =
        (List<CompiledValue>) queryComponents.remove(OQLLexerTokenTypes.LITERAL_group);

    // whatever remains , treat it as where whereClause
    CompiledValue where = null;

    if (queryComponents.size() == 1) {
      where = (CompiledValue) queryComponents.values().iterator().next();
      // Where clause can not contain aggregate functions.
      checkWhereClauseForAggregates(where);
    } else if (queryComponents.size() > 1) {
      throw new QueryInvalidException("Unexpected/unsupported query clauses found");
    }
    LinkedHashMap<Integer, CompiledAggregateFunction> aggMap =
        identifyAggregateExpressions(projAttrs);
    boolean isCountOnly = checkForCountOnly(aggMap, projAttrs, groupByClause);
    if (isCountOnly) {
      projAttrs = null;
    }
    CompiledSelect select = createSelect(distinct != null, isCountOnly, where, iterators, projAttrs,
        orderByAttrs, limit, hints, groupByClause, aggMap);
    push(select);
  }
Processes import statements only. This compiler instance remembers the imports and can be used
to compile other strings with this context info
geode-core/src/main/java/org/apache/geode/cache/query/internal/QCompiler.java