private static int getLimitValue(ExecutionContext context) {
    int limit = -1;
    if (context.cacheGet(CompiledValue.ORDERBY_ATTRIB) == null) {
      limit = context.cacheGet(CompiledValue.RESULT_LIMIT) != null
          ? (Integer) context.cacheGet(CompiledValue.RESULT_LIMIT) : -1;
    }
    return limit;
  }
NOTE: intermediateResults should be a single element array
<p>
NOTE: itrsForIntermediateResults should be a two dimensional array but with only one row
<p>
TODO: This function is used to do cartesian of index resultset while
<p>
expanding/cutting down index resultset with the intermediate resultset
geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java