@Override
    protected Type visitExists(ExistsPredicate node, StackableAstVisitorContext<Context> context) {
      StatementAnalyzer analyzer =
          statementAnalyzerFactory.apply(node, context.getContext().getCorrelationSupport());
      Scope subqueryScope = Scope.builder().withParent(context.getContext().getScope()).build();

      List<RowType.Field> fields =
          analyzer
              .analyze(node.getSubquery(), subqueryScope)
              .getRelationType()
              .getAllFields()
              .stream()
              .map(
                  field -> {
                    if (field.getName().isPresent()) {
                      return RowType.field(field.getName().get(), field.getType());
                    }

                    return RowType.field(field.getType());
                  })
              .collect(toImmutableList());

      // TODO: this should be multiset(row(...))
      setExpressionType(node.getSubquery(), RowType.from(fields));

      existsSubqueries.add(NodeRef.of(node));

      return setExpressionType(node, BOOLEAN);
    }
@return the common supertype between the value type and subquery type
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/ExpressionAnalyzer.java