static String formatWindowSpecification(WindowSpecification windowSpecification) {
    List<String> parts = new ArrayList<>();

    if (windowSpecification.getExistingWindowName().isPresent()) {
      parts.add(formatExpression(windowSpecification.getExistingWindowName().get()));
    }
    if (!windowSpecification.getPartitionBy().isEmpty()) {
      parts.add(
          "PARTITION BY "
              + windowSpecification.getPartitionBy().stream()
                  .map(ExpressionFormatter::formatExpression)
                  .collect(joining(", ")));
    }
    if (windowSpecification.getOrderBy().isPresent()) {
      parts.add(formatOrderBy(windowSpecification.getOrderBy().get()));
    }
    if (windowSpecification.getFrame().isPresent()) {
      parts.add(formatFrame(windowSpecification.getFrame().get()));
    }

    return '(' + Joiner.on(' ').join(parts) + ')';
  }
Returns the formatted `LISTAGG` function call corresponding to the specified node.

<p>During the parsing of the syntax tree, the `LISTAGG` expression is synthetically converted
to a function call. This method formats the specified {@link FunctionCall} node to correspond
to the standardised syntax of the `LISTAGG` expression.

@param node the `LISTAGG` function call
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/util/ExpressionFormatter.java