static CompiledValue obtainTheBottomMostCompiledValue(CompiledValue expr) {
    boolean toContinue = true;
    int exprType = expr.getType();
    while (toContinue) {
      switch (exprType) {
        case OQLLexerTokenTypes.RegionPath:
          toContinue = false;
          break;
        case OQLLexerTokenTypes.METHOD_INV:
          CompiledOperation operation = (CompiledOperation) expr;
          // pass the ExecutionContext as null, thus never implicitly resolving to RuntimeIterator
          expr = operation.getReceiver(null);
          if (expr == null) {
            expr = operation;
            toContinue = false;
          }
          break;
        case CompiledValue.PATH:
          expr = expr.getReceiver();
          break;
        case OQLLexerTokenTypes.TOK_LBRACK:
          expr = expr.getReceiver();
          break;
        default:
          toContinue = false;
          break;
      }
      if (toContinue) {
        exprType = expr.getType();
      }
    }
    return expr;
  }
This function will evaluate the starting CompiledValue for a given CompliedValue. The value
returned will always be either the original CompiledValue, or a CompiledID, or a
CompiledRegion, or a CompiledBindArgument, or a CompiledOperation. The ExecutionContext passed
can be null. If it is null, then for a CompiledOperation , if supposed to get resolved
implicitly, will have its receiver as null. This is because in normal cases , a CompiledID
marks the termination, but in case of CompiledOperation this is not the case

@param expr CompiledValue object
geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java