@Override
    protected Type visitQuantifiedComparisonExpression(
        QuantifiedComparisonExpression node, StackableAstVisitorContext<Context> context) {
      quantifiedComparisons.add(NodeRef.of(node));

      Type declaredValueType = process(node.getValue(), context);
      Type comparisonType =
          analyzePredicateWithSubquery(
              node, declaredValueType, (SubqueryExpression) node.getSubquery(), context);

      switch (node.getOperator()) {
        case LESS_THAN:
        case LESS_THAN_OR_EQUAL:
        case GREATER_THAN:
        case GREATER_THAN_OR_EQUAL:
          if (!comparisonType.isOrderable()) {
            throw new SemanticException(
                String.format(
                    "Type [%s] must be orderable in order to be used in quantified comparison",
                    comparisonType));
          }
          break;
        case EQUAL:
        case NOT_EQUAL:
          if (!comparisonType.isComparable()) {
            throw new SemanticException(
                String.format(
                    "Type [%s] must be comparable in order to be used in quantified comparison",
                    comparisonType));
          }
          break;
        default:
          throw new IllegalStateException(
              String.format("Unexpected comparison type: %s", node.getOperator()));
      }

      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