private static IDPredicate parseComparison(
      ComparisonExpression comparisonExpression,
      TimeRange timeRange,
      IDPredicate oldPredicate,
      TsTable table) {
    Expression left = comparisonExpression.getLeft();
    Expression right = comparisonExpression.getRight();
    if (!(left instanceof Identifier)) {
      throw new SemanticException("The left hand value must be an identifier: " + left);
    }
    Identifier identifier = (Identifier) left;
    // time predicate
    if (identifier.getValue().equalsIgnoreCase("time")) {
      long rightHandValue;
      if (right instanceof LongLiteral) {
        rightHandValue = ((LongLiteral) right).getParsedValue();
      } else {
        throw new SemanticException(
            "The right hand value of time predicate must be a long: " + right);
      }

      switch (comparisonExpression.getOperator()) {
        case LESS_THAN:
          timeRange.setEndTime(Math.min(timeRange.getEndTime(), rightHandValue - 1));
          break;
        case LESS_THAN_OR_EQUAL:
          timeRange.setEndTime(Math.min(timeRange.getEndTime(), rightHandValue));
          break;
        case GREATER_THAN:
          timeRange.setStartTime(Math.max(timeRange.getStartTime(), rightHandValue + 1));
          break;
        case GREATER_THAN_OR_EQUAL:
          timeRange.setStartTime(Math.max(timeRange.getStartTime(), rightHandValue));
          break;
        case EQUAL:
          timeRange.setStartTime(rightHandValue);
          timeRange.setEndTime(rightHandValue);
          break;
        case NOT_EQUAL:
        case IS_DISTINCT_FROM:
        default:
          throw new SemanticException(
              "The operator of time predicate must be <, <=, >, or >=: " + right);
      }

      return oldPredicate;
    }
    // id predicate
    String columnName = identifier.getValue();
    int idColumnOrdinal = table.getTagColumnOrdinal(columnName);
    if (idColumnOrdinal == -1) {
      throw new SemanticException(
          "The column '" + columnName + "' does not exist or is not a tag column");
    }

    IDPredicate newPredicate = getIdPredicate(comparisonExpression, right, idColumnOrdinal);
    return combinePredicates(oldPredicate, newPredicate);
  }
Convert to a disjunctive normal forms.

<p>For example: ( A | B ) & ( C | D ) => ( A & C ) | ( A & D ) | ( B & C ) | ( B & D)

<p>Returns the original expression if the expression is null or if the distribution will expand
the expression by too much.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeUtils.java