@Override
  public boolean isLimitApplicableAtIndexLevel(ExecutionContext context)
      throws FunctionDomainException, TypeMismatchException, NameResolutionException,
      QueryInvocationTargetException {
    if (_operator == LITERAL_or) {
      // There is a slight inefficiency in the sense that if the subjunction ( say AND) cannot apply
      // limit,
      // then limit would not be applied at remaining conditions of OR. But since we have single
      // flag
      // governing the behaviour of applying limit at index level, we cannot make it true for
      // specific clauses
      for (final CompiledValue operand : _operands) {
        if (!operand.getPlanInfo(context).evalAsFilter
            || ((Filter) operand).isLimitApplicableAtIndexLevel(context)) {
          return false;
        }
      }
      return true;
    } else {
      // For limit to be applicable on a AND junction, there should be only one type of index used
      // and rest iter evaluable
      // But since the selection of which index to use happens in GroupJunction created at runtimke,
      // we do not have that
      // information yet, and at this point there would be multiple indexes. Ideally we should
      // invoke this function in GroupJunction,
      // in case we want to support multi index usage again at some point. Till then since it is
      // hard coded to use 1 index
      // we can for the time being return true if there exists atleast one indexable condition
      boolean foundIndex = false;
      for (final CompiledValue operand : _operands) {
        if (operand.getPlanInfo(context).evalAsFilter
            && operand.getType() == JUNCTION) {
          return false;
        } else if (operand.getPlanInfo(context).evalAsFilter) {
          foundIndex = true;
        }
      }
      return foundIndex;
    }
  }
Creates a GroupJunction or a RangeJunction based on the operands passed. The operands are
either Filter Operands belonging to single independent RuntimeIterator or are iter evaluable on
the RuntimeIterator[] passed as parameter. If all the filter evaluable operands use a single
Index , than a RangeJunction is created with iter operand as part of RangeJunction. If there
exists operands using multiple indexes, then a GroupJunction is created. In that case , the
operands using the same index are grouped in a RangeJunction & that Range Junction becomes part
of the GroupJunction. A GroupJunction may contain one or more RangeJunction

@param needsCompacting boolean indicating if there is a possibility of RangeJunction or not. If
       needsCompacting is false , then a GroupJunction will be formed, without any
       RangeJunction
@param grpIndpndntItr Array of RuntimeIterator which represents the independent iterator for
       the Group. for all cases , except a CompositeGroupJunction containing a single
       GroupJunction , will have a single RuntimeIterator in this array.
@param completeExpnsn boolean indicating whether the Group or Range Junction needs to be
       expanded to the query from clause level or the group level
@param cv Array of CompiledValue containing operands belonging to a group
@param sameIndexOperands Map object containing Index as the key & as a value an Integer object
       or a List. If it contains an Integer as value against Index, it implies that there is
       only one operand which uses that type of index & hence cannot form a RangeJunction. If
       it contains a List then the Lis contains the operands which use same index & thus can
       form a RangeJunction
@return Object of GroupJunction or RangeJunction as the case may be
geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledJunction.java