public static TSDataType getBuiltinAggregationTypeByFuncName(String aggregation) {
    if (aggregation == null) {
      return null;
    }
    switch (aggregation.toLowerCase()) {
      case SqlConstant.MIN_TIME:
      case SqlConstant.MAX_TIME:
      case SqlConstant.COUNT:
      case SqlConstant.TIME_DURATION:
      case SqlConstant.COUNT_TIME:
        return TSDataType.INT64;
      case SqlConstant.AVG:
      case SqlConstant.SUM:
      case SqlConstant.STDDEV:
      case SqlConstant.STDDEV_POP:
      case SqlConstant.STDDEV_SAMP:
      case SqlConstant.VARIANCE:
      case SqlConstant.VAR_POP:
      case SqlConstant.VAR_SAMP:
        return TSDataType.DOUBLE;
        // Partial aggregation names
      case SqlConstant.STDDEV + "_partial":
      case SqlConstant.STDDEV_POP + "_partial":
      case SqlConstant.STDDEV_SAMP + "_partial":
      case SqlConstant.VARIANCE + "_partial":
      case SqlConstant.VAR_POP + "_partial":
      case SqlConstant.VAR_SAMP + "_partial":
      case SqlConstant.MAX_BY + "_partial":
      case SqlConstant.MIN_BY + "_partial":
        return TSDataType.TEXT;
      case SqlConstant.LAST_VALUE:
      case SqlConstant.FIRST_VALUE:
      case SqlConstant.MIN_VALUE:
      case SqlConstant.MAX_VALUE:
      case SqlConstant.MODE:
      case SqlConstant.MAX_BY:
      case SqlConstant.MIN_BY:
      default:
        return null;
    }
  }
@param aggregation aggregation function
@return the data type of the aggregation or null if it aggregation is null
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/SchemaUtils.java