private static void addAdditionalFilters(
          RelBuilder relBuilder,
          HiveLoptMultiJoin multiJoin,
          HiveLoptJoinTree left,
          HiveLoptJoinTree right,
          List<RexNode> filtersToAdd) {
    RexNode filterCond =
            addFilters(multiJoin, left, -1, right, filtersToAdd, false);
    if (!filterCond.isAlwaysTrue()) {
      // adjust the filter to reflect the outer join output
      int [] adjustments = new int[multiJoin.getNumTotalFields()];
      if (needsAdjustment(multiJoin, adjustments, left, right, false)) {
        RexBuilder rexBuilder =
                multiJoin.getMultiJoinRel().getCluster().getRexBuilder();
        filterCond =
                filterCond.accept(
                        new RelOptUtil.RexInputConverter(
                                rexBuilder,
                                multiJoin.getMultiJoinFields(),
                                relBuilder.peek().getRowType().getFieldList(),
                                adjustments));
        relBuilder.filter(filterCond);
      }
    }
  }
Determines whether any additional filters are applicable to a join tree.
If there are any, creates a filter node on top of the join tree with the
additional filters.

@param relBuilder Builder holding current join tree
@param multiJoin join factors being optimized
@param left left side of join tree
@param right right side of join tree
@param filtersToAdd remaining filters
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveLoptOptimizeJoinRule.java