@Override
  public SelectResults filterEvaluate(ExecutionContext context, SelectResults intermediateResults)
      throws FunctionDomainException, TypeMismatchException, NameResolutionException,
      QueryInvocationTargetException {
    // for the general case of filter evaluation, most compiled values
    // can only be evaluated in this way if they are independent of the current
    // iterator,
    // This method is also only applicable in places where a boolean value is
    // expected.
    // RuntimeIterator itr = context.getCurrentIterator();
    // Support.Assert(itr != null);
    // if it is possible for the following assertion to be false,
    // then this method as well as protGetPlanInfo must be overridden
    Support.Assert(!isDependentOnCurrentScope(context));
    Object result = evaluate(context);
    if (result == null || result == QueryService.UNDEFINED) {
      return new ResultsBag(intermediateResults.getCollectionType().getElementType(), 0,
          context.getCachePerfStats());
    }
    if (!(result instanceof Boolean)) {
      throw new TypeMismatchException(
          String.format("boolean value expected, not type ' %s '",
              result.getClass().getName()));
    }
    boolean b = (Boolean) result;
    // Asif : Boolean true, means the cartesian of all the RuntimeIterators
    // indicated by null value. A false means an empty ResultSet
    if (b) {
      return null;
    } else {
      // Asif : We need to return either an empty ResultSet or an empty
      // StructSet based
      // on the number of iterators in the current scope.
      SelectResults emptySet = null;
      List iterators = context.getCurrentIterators();
      int len = iterators.size();
      if (len == 1) {
        ObjectType elementType = ((RuntimeIterator) iterators.get(0)).getElementType();
        emptySet = context.isDistinct() ? new ResultsSet(elementType)
            : new ResultsBag(elementType, 0, context.getCachePerfStats());
      } else {
        String[] fieldNames = new String[len];
        ObjectType[] fieldTypes = new ObjectType[len];
        for (int i = 0; i < len; i++) {
          RuntimeIterator iter = (RuntimeIterator) iterators.get(i);
          fieldNames[i] = iter.getInternalId();
          fieldTypes[i] = iter.getElementType();
        }
        emptySet = context.isDistinct() ? new StructSet(new StructTypeImpl(fieldNames, fieldTypes))
            : new StructBag(0, new StructTypeImpl(fieldNames, fieldTypes),
                context.getCachePerfStats());
      }
      return emptySet;
    }
  }
this is a lower level filter evaluation call. Most Filters do nothing different here than a
normal filterEvaluate. This is here for benefit of nested CompiledJunctions: filterEvaluate is
called first, then auxFilterEvaluate is called on the operands that have been organized to be
filters

@see CompiledJunction#filterEvaluate
geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractCompiledValue.java