@Override
  public void setGroupCount(long groupCount) {
    inits.ensureCapacity(groupCount);
    xNulls.ensureCapacity(groupCount);
    switch (xDataType) {
      case INT32:
      case DATE:
        xIntValues.ensureCapacity(groupCount);
        break;
      case INT64:
      case TIMESTAMP:
        xLongValues.ensureCapacity(groupCount);
        break;
      case FLOAT:
        xFloatValues.ensureCapacity(groupCount);
        break;
      case DOUBLE:
        xDoubleValues.ensureCapacity(groupCount);
        break;
      case TEXT:
      case STRING:
      case BLOB:
        xBinaryValues.ensureCapacity(groupCount);
        break;
      case BOOLEAN:
        xBooleanValues.ensureCapacity(groupCount);
        break;
      default:
        throw new UnSupportedDataTypeException(
            String.format("Unsupported data type in MAX_BY/MIN_BY Aggregation: %s", xDataType));
    }
    switch (yDataType) {
      case INT32:
      case DATE:
        yIntValues.ensureCapacity(groupCount);
        break;
      case INT64:
      case TIMESTAMP:
        yLongValues.ensureCapacity(groupCount);
        break;
      case FLOAT:
        yFloatValues.ensureCapacity(groupCount);
        break;
      case DOUBLE:
        yDoubleValues.ensureCapacity(groupCount);
        break;
      case TEXT:
      case STRING:
      case BLOB:
        yBinaryValues.ensureCapacity(groupCount);
        break;
      case BOOLEAN:
        yBooleanValues.ensureCapacity(groupCount);
        break;
      default:
        throw new UnSupportedDataTypeException(
            String.format("Unsupported data type in MAX_BY/MIN_BY Aggregation: %s", xDataType));
    }
  }
max(x,y) returns the value of x associated with the maximum value of y over all input values.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/aggregation/grouped/GroupedMaxMinByBaseAccumulator.java