public static ResolvedFunction getResolvedBuiltInAggregateFunction(
      Metadata metadata, String functionName, List<Type> argumentTypes) {
    // The same as the code in ExpressionAnalyzer
    Type type = metadata.getFunctionReturnType(functionName, argumentTypes);
    return new ResolvedFunction(
        new BoundSignature(functionName.toLowerCase(Locale.ENGLISH), type, argumentTypes),
        FunctionId.NOOP_FUNCTION_ID,
        FunctionKind.AGGREGATE,
        true,
        FunctionNullability.getAggregationFunctionNullability(argumentTypes.size()));
  }
Split AggregationTableScanNode into two-stage.

@return left of pair is FINAL AggregationNode, right is PARTIAL AggregationTableScanNode
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/Util.java