private static List<Expression> removeDuplicates(List<Expression> expressions) {
    Set<Expression> seen = new HashSet<>();

    ImmutableList.Builder<Expression> result = ImmutableList.builder();
    for (Expression expression : expressions) {
      if (!DeterminismEvaluator.isDeterministic(expression)) {
        result.add(expression);
      } else if (!seen.contains(expression)) {
        result.add(expression);
        seen.add(expression);
      }
    }

    return result.build();
  }
Removes duplicate deterministic expressions. Preserves the relative order of the expressions in
the list.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/ir/IrUtils.java