private void prepareIndexExpression(String indexedExpression) throws IndexInvalidException {
    CompiledValue expr = compiler.compileQuery(indexedExpression);
    if (expr == null) {
      throw new IndexInvalidException(
          String.format("Invalid indexed expression : ' %s '",
              indexedExpression));
    }

    if (expr instanceof CompiledUndefined || expr instanceof CompiledLiteral
        || expr instanceof CompiledComparison || expr instanceof CompiledBindArgument
        || expr instanceof CompiledNegation) {
      throw new IndexInvalidException(
          String.format("Invalid indexed expression : ' %s '",
              indexedExpression));
    }

    try {
      StringBuilder sb = new StringBuilder();
      if (expr instanceof MapIndexable) {
        MapIndexable mi = (MapIndexable) expr;
        List<CompiledValue> indexingKeys = mi.getIndexingKeys();

        if (indexingKeys.size() == 1 && indexingKeys.get(0) == CompiledValue.MAP_INDEX_ALL_KEYS) {
          isMapTypeIndex = true;
          isAllKeys = true;
          // Strip the index operator
          expr = mi.getReceiverSansIndexArgs();
          expr.generateCanonicalizedExpression(sb, context);
          sb.append('[').append('*').append(']');

        } else if (indexingKeys.size() == 1) {
          expr.generateCanonicalizedExpression(sb, context);

        } else {
          isMapTypeIndex = true;
          multiIndexKeysPattern = new String[indexingKeys.size()];
          mapKeys = new Object[indexingKeys.size()];
          expr = mi.getReceiverSansIndexArgs();
          expr.generateCanonicalizedExpression(sb, context);
          sb.append('[');
          String prefixStr = sb.toString();
          StringBuilder sb2 = new StringBuilder();

          int size = indexingKeys.size();
          for (int j = 0; j < size; ++j) {
            CompiledValue cv = indexingKeys.get(size - j - 1);
            mapKeys[size - j - 1] = cv.evaluate(context);
            StringBuilder sb3 = new StringBuilder();
            cv.generateCanonicalizedExpression(sb3, context);
            sb3.insert(0, prefixStr);
            sb3.append(']');
            multiIndexKeysPattern[j] = sb3.toString();
            cv.generateCanonicalizedExpression(sb2, context);
            sb2.insert(0, ',');
          }
          sb2.deleteCharAt(0);
          sb.append(sb2);
          sb.append(']');

        }
      } else {
        expr.generateCanonicalizedExpression(sb, context);
      }

      this.indexedExpression = sb.toString();
      modifiedIndexExpr = expr;
      if (!isFirstIteratorRegionEntry
          && this.indexedExpression.contains(canonicalizedIteratorNames[0])) {
        modifiedIndexExpr = getModifiedDependentCompiledValue(context, -1, expr, true);
      }
    } catch (Exception e) {
      throw new IndexInvalidException(
          String.format("Invalid indexed expression : ' %s '",
              indexedExpression),
          e);
    }
    indexedExpr = expr;
  }
This function is modified so that if the indexed expression has any dependency on the 0th
iterator, then it needs to modified by using the missing link so that it is derivable from the
0th iterator.
<p>
TODO: refactor large method prepareIndexExpression
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/FunctionalIndexCreationHelper.java