private PlanBuilder addNegation(
      PlanBuilder subPlan, Cluster<? extends Expression> cluster, Symbol input) {
    Symbol output = symbolAllocator.newSymbol("not", BOOLEAN);

    return new PlanBuilder(
        subPlan
            .getTranslations()
            .withAdditionalMappings(mapAll(cluster, subPlan.getScope(), output)),
        new ProjectNode(
            idAllocator.genPlanNodeId(),
            subPlan.getRoot(),
            Assignments.builder()
                .putIdentities(subPlan.getRoot().getOutputSymbols())
                .put(output, new NotExpression(input.toSymbolReference()))
                .build()));
  }
Adds a negation of the given input and remaps the provided expression to the negated expression
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/SubqueryPlanner.java