private PlanBuilder planExists(PlanBuilder subPlan, Cluster<ExistsPredicate> cluster) {
    // Plan one of the predicates from the cluster
    ExistsPredicate existsPredicate = cluster.getRepresentative();

    Expression subquery = existsPredicate.getSubquery();
    Symbol exists = symbolAllocator.newSymbol("exists", BOOLEAN);

    return new PlanBuilder(
        subPlan
            .getTranslations()
            .withAdditionalMappings(mapAll(cluster, subPlan.getScope(), exists)),
        new ApplyNode(
            idAllocator.genPlanNodeId(),
            subPlan.getRoot(),
            planSubquery(subquery, subPlan.getTranslations()).getRoot(),
            ImmutableMap.of(exists, new ApplyNode.Exists()),
            subPlan.getRoot().getOutputSymbols(),
            subquery));
  }
Plans a correlated subquery for value IN (subQuery)

@param originalExpression the original expression from which the IN predicate was derived. Used
    for subsequent translations.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/SubqueryPlanner.java