public static boolean hasAnyExpressionFromRightSide(RelNode joinRel, List<RexNode> expressions)  {
    List<RelDataTypeField> joinFields = joinRel.getRowType().getFieldList();
    int nTotalFields = joinFields.size();
    List<RelDataTypeField> leftFields = (joinRel.getInputs().get(0)).getRowType().getFieldList();
    int nFieldsLeft = leftFields.size();
    ImmutableBitSet rightBitmap = ImmutableBitSet.range(nFieldsLeft, nTotalFields);

    for (RexNode node : expressions) {
      ImmutableBitSet inputBits = RelOptUtil.InputFinder.bits(node);
      if (rightBitmap.contains(inputBits)) {
        return true;
      }
    }
    return false;
  }
Checks if any of the expression given as list expressions are from right side of the join.
 This is used during anti join conversion.

@param joinRel Join node whose right side has to be searched.
@param expressions The list of expression to search.
@return true if any of the expressions is from right side of join.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveCalciteUtil.java