private List<RexNode> getResidualFilterNodes(Filter filter, Join join) {
    // 1. If null filter is not present from right side then we can not convert to anti join.
    // 2. If any non-null filter is present from right side, we can not convert it to anti join.
    // 3. Keep other filters which needs to be executed after join.
    // 4. The filter conditions are decomposed on AND conditions only.
    //TODO If some conditions like (fld1 is null or fld2 is null) present, it will not be considered for conversion.
    //https://issues.apache.org/jira/browse/HIVE-23992
    List<RexNode> aboveFilters = RelOptUtil.conjunctions(filter.getCondition());
    boolean hasNullFilterOnRightSide = false;
    List<RexNode> filterList = new ArrayList<>();
    for (RexNode filterNode : aboveFilters) {
      if (filterNode.getKind() == SqlKind.IS_NULL) {
        // Null filter from right side table can be removed and its a pre-condition for anti join conversion.
        if (HiveCalciteUtil.hasAllExpressionsFromRightSide(join, Collections.singletonList(filterNode))
            && isStrong(((RexCall) filterNode).getOperands().get(0))) {
          hasNullFilterOnRightSide = true;
        } else {
          filterList.add(filterNode);
        }
      } else {
        if (HiveCalciteUtil.hasAnyExpressionFromRightSide(join, Collections.singletonList(filterNode))) {
          // If some non null condition is present from right side, we can not convert the join to anti join as
          // anti join does not project the fields from right side.
          return null;
        } else {
          filterList.add(filterNode);
        }
      }
    }

    if (!hasNullFilterOnRightSide) {
      return null;
    }
    return filterList;
  }
Extracts the non-null filter conditions from given filter node.

@param filter The filter condition to be checked.
@param join Join node whose right side has to be searched.
@return null : Anti join condition is not matched for filter.
        Empty list : No residual filter conditions present.
        Valid list containing the filter to be applied after join.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveAntiSemiJoinRule.java