@Override
  public RexNode visitInputRef(RexInputRef inputRef) {
    if (inputRef.getIndex() >= startIndex) {
      RexBuilder rexBuilder = relBuilder.getRexBuilder();
      return rexBuilder.makeInputRef(inputRef.getType(), inputRef.getIndex() + shift);
    }
    return inputRef;
  }
Shift input reference index by the specified amount (shift) if the referenced column index is higher or equals with
the startIndex.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/InputRefShifter.java