static SelectResults getConditionedIndexResults(SelectResults indexResults, IndexInfo indexInfo,
      ExecutionContext context, int indexFieldsSize, boolean completeExpansion,
      CompiledValue iterOperands, RuntimeIterator[] grpIndpndntItr) throws FunctionDomainException,
      TypeMismatchException, NameResolutionException, QueryInvocationTargetException {
    if (!completeExpansion && grpIndpndntItr != null && grpIndpndntItr.length > 1) {
      // If for a Single Base Collection Index usage we are having
      // independent
      // group of iterators with size greater than 1 , that implies it is being
      // invoked
      // from CompositeGroupJunction with a single GroupJunction present in it.
      // If it so happens that Complete expansion is false, this implies that we
      // need to expand
      // it to CompositeGroupJunction level. We will esnure in
      // CompositeGroupJunction that
      // we pass an array of independent iterators of size > 1 only if complete
      // expansion is false
      IndexConditioningHelper ich = new IndexConditioningHelper(indexInfo, context, indexFieldsSize,
          completeExpansion, iterOperands, null);
      // We will definitely need shuffling as a CompositeGroupJunction itself
      // indicates
      // that there will be at least one independent group to which we need to
      // expand to
      ich.finalList = getDependentItrChainForIndpndntItrs(grpIndpndntItr, context);
      // Add the iterators of remaining independent grp to the expansion list
      List newExpList = new ArrayList();
      int len = grpIndpndntItr.length;
      RuntimeIterator tempItr = null;
      for (RuntimeIterator aGrpIndpndntItr : grpIndpndntItr) {
        tempItr = aGrpIndpndntItr;
        if (tempItr != ich.indpndntItr) {
          newExpList.addAll(context.getCurrScopeDpndntItrsBasedOnSingleIndpndntItr(tempItr));
        }
      }
      newExpList.addAll(ich.expansionList);
      ich.expansionList = newExpList;
      QueryObserver observer = QueryObserverHolder.getInstance();
      try {
        observer.beforeCutDownAndExpansionOfSingleIndexResult(indexInfo._index, indexResults);
        indexResults =
            QueryUtils.cutDownAndExpandIndexResults(indexResults, ich.indexFieldToItrsMapping,
                ich.expansionList, ich.finalList, context, ich.checkList, iterOperands, indexInfo);
      } finally {
        observer.afterCutDownAndExpansionOfSingleIndexResult(indexResults);
      }
    } else {
      IndexConditioningHelper ich = new IndexConditioningHelper(indexInfo, context, indexFieldsSize,
          completeExpansion, iterOperands, grpIndpndntItr != null ? grpIndpndntItr[0] : null);
      if (ich.shufflingNeeded) {
        QueryObserver observer = QueryObserverHolder.getInstance();
        try {
          observer.beforeCutDownAndExpansionOfSingleIndexResult(indexInfo._index, indexResults);
          indexResults = QueryUtils.cutDownAndExpandIndexResults(indexResults,
              ich.indexFieldToItrsMapping, ich.expansionList, ich.finalList, context, ich.checkList,
              iterOperands, indexInfo);
        } finally {
          observer.afterCutDownAndExpansionOfSingleIndexResult(indexResults);
        }
      } else if (indexInfo.mapping.length > 1) {
        indexResults.setElementType(ich.structType);
      }
    }
    return indexResults;
  }
Conditions the raw index result obtained on a non composite condition ( i.e a condition with a
format of variable = constant . A constant may be either a CompiledLiteral or an expression
which is completely dependent on iterators other than the current scope. The variable is a path
expression which is completely dependent on iterators belonging only to a single region ( i.e
iterators belonging to a Group of iterators only dependent on a single indpendent iterator for
the region). The raw index result is appropriately expanded / cutdown with evaluation of iter
operand if any , StructType/ObjectType appropriately set, Shuffling of the fields appropriately
done, such that the final result is compatible, in terms of the position and names of the
fields of SelectResults( StructBag) , with the Iterators of the query from clause ( if complete
expansion flag is true) or the chain of iterators identified by the indpendent iterator for the
group.

@param indexResults The raw index results which may be a ResultBag object or an StructBag
       object
@param indexInfo IndexInfo object containing data such as match level & the mapping of the
       position of Runtime Iterators of the group to the position of the corresponding field in
       the index result ( StructBag)
@param context ExecutionContext object
@param indexFieldsSize The number of fields contained in the raw index resultset
@param completeExpansion The boolean indicating whether the index resultset needs to be
       expanded to the query from clause level ( i.e top level)
@param iterOperands The CompiledValue representing the iter operand which needs to be evaluated
       during conditioning of index resultset
@param grpIndpndntItr An Array of Independent Iterators representing their respective groups.
       The conditioned Index Resultset will be created as per the chain of dependent iterators
       for each group.
@return SelectResults object representing the conditioned Results
geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java