Code review comment: do we need to add cases to cover null as (b.id1 + b.id2)?

Code under review:
private Plan toAntiJoin(LogicalFilter<LogicalJoin<Plan, Plan>> filter) {
        LogicalJoin<Plan, Plan> join = filter.child();

        Set<Slot> alwaysNullSlots = filter.getConjuncts().stream()
                .filter(p -> TypeUtils.isNull(p).isPresent())
                .flatMap(p -> p.getInputSlots().stream())
                .collect(Collectors.toSet());
        Set<Slot> leftAlwaysNullSlots = join.left().getOutputSet().stream()
                .filter(s -> alwaysNullSlots.contains(s) && !s.nullable())
                .collect(Collectors.toSet());
        Set<Slot> rightAlwaysNullSlots = join.right().getOutputSet().stream()
                .filter(s -> alwaysNullSlots.contains(s) && !s.nullable())
                .collect(Collectors.toSet());

        Plan newJoin = null;
        if (join.getJoinType().isLeftOuterJoin() && !rightAlwaysNullSlots.isEmpty()) {
            newJoin = join.withJoinType(JoinType.LEFT_ANTI_JOIN, join.getJoinReorderContext());
        }
        if (join.getJoinType().isRightOuterJoin() && !leftAlwaysNullSlots.isEmpty()) {
            newJoin = join.withJoinType(JoinType.RIGHT_ANTI_JOIN, join.getJoinReorderContext());
        }
        if (newJoin == null) {
            return null;
        }

        if (!newJoin.getOutputSet().containsAll(filter.getInputSlots())) {
            Set<Slot> joinOutput = newJoin.getOutputSet();
            List<NamedExpression> projects = filter.getOutput().stream()
                    .map(s -> {
                        if (joinOutput.contains(s)) {
                            return s;
                        } else {
                            return new Alias(s.getExprId(), new NullLiteral(s.getDataType()), s.getName());
                        }
                    }).collect(Collectors.toList());
            newJoin = new LogicalProject<>(projects, newJoin);
        }
        return filter.withChildren(newJoin);
    }

Line commented on: if (!newJoin.getOutputSet().containsAll(filter.getInputSlots())) {

Revised code:
private Plan toAntiJoin(LogicalFilter<LogicalJoin<Plan, Plan>> filter) {
        LogicalJoin<Plan, Plan> join = filter.child();

        Set<Slot> alwaysNullSlots = filter.getConjuncts().stream()
                .filter(p -> TypeUtils.isNull(p).isPresent())
                .flatMap(p -> p.getInputSlots().stream())
                .collect(Collectors.toSet());
        Set<Slot> leftAlwaysNullSlots = join.left().getOutputSet().stream()
                .filter(s -> alwaysNullSlots.contains(s) && !s.nullable())
                .collect(Collectors.toSet());
        Set<Slot> rightAlwaysNullSlots = join.right().getOutputSet().stream()
                .filter(s -> alwaysNullSlots.contains(s) && !s.nullable())
                .collect(Collectors.toSet());

        Plan newJoin = null;
        if (join.getJoinType().isLeftOuterJoin() && !rightAlwaysNullSlots.isEmpty()) {
            newJoin = join.withJoinType(JoinType.LEFT_ANTI_JOIN, join.getJoinReorderContext());
        }
        if (join.getJoinType().isRightOuterJoin() && !leftAlwaysNullSlots.isEmpty()) {
            newJoin = join.withJoinType(JoinType.RIGHT_ANTI_JOIN, join.getJoinReorderContext());
        }
        if (newJoin == null) {
            return null;
        }

        if (!newJoin.getOutputSet().containsAll(filter.getInputSlots())) {
            
            
            
            
            Set<Slot> joinOutput = newJoin.getOutputSet();
            List<NamedExpression> projects = filter.getOutput().stream()
                    .map(s -> {
                        if (joinOutput.contains(s)) {
                            return s;
                        } else {
                            return new Alias(s.getExprId(), new NullLiteral(s.getDataType()), s.getName());
                        }
                    }).collect(Collectors.toList());
            newJoin = new LogicalProject<>(projects, newJoin);
        }
        return filter.withChildren(newJoin);
    }