@Override
  public SelectResults filterEvaluate(ExecutionContext context, SelectResults intermediateResults)
      throws FunctionDomainException, TypeMismatchException, NameResolutionException,
      QueryInvocationTargetException {
    // Asif : This function can be invoked only if the where clause contains
    // a single condition which is CompiledComparison.
    // If a CompiledComparison exists inside a GroupJunction, then it will
    // always
    // call the overloaded filterEvalauate with the RuntimeIterator passed
    // as not null.
    // Thus if the RuntimeIterator array passed is null then it is
    // guaranteed
    // that the condition was a isolatory condition ( directly in where
    // clause)
    // and the final iterators to which we need to expand to is all the
    // iterators
    // of the scope
    RuntimeIterator indpndntItr = null;

    List currentScopeIndpndntItrs = context.getAllIndependentIteratorsOfCurrentScope();
    Set rntmItrs = QueryUtils.getCurrentScopeUltimateRuntimeIteratorsIfAny(this, context);
    if (rntmItrs.size() == 1 && currentScopeIndpndntItrs.size() == 1) {
      indpndntItr = (RuntimeIterator) rntmItrs.iterator().next();
    }


    return filterEvaluate(context, intermediateResults, true/*
                                                             * Complete Expansion needed
                                                             */, null,
        indpndntItr != null ? new RuntimeIterator[] {indpndntItr}
            : null/*
                   * Asif :It is safe to pass null as the independent iterator to which the
                   * condition belongs is required only if boolean complete expansion turns out to
                   * be false, which can happen only in case of CompiledComparison/CompiledUndefined
                   * called from roupJunction or CompositeGroupJunction
                   */,
        true, isConditioningNeededForIndex(indpndntItr, context, true),
        true /* evaluate projection attribute */);
  }
evaluate as a filter, producing an intermediate result set. This may require iteration if there
is no index available. Asif :The booelan true implies that CompiledComparsion when existing on
its own always requires a Completeexpansion to top level iterators. This flag can get toggled
to false only from inside a GroupJunction

@param intermediateResults if this parameter is provided, and we have to iterate, then iterate
       over this result set instead of the entire base collection.
geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledComparison.java