private byte[] serialize() {
    byte[] valueBytes;
    int yLength = calcTypeSize(yDataType, yExtremeValue);
    if (xNull) {
      valueBytes = new byte[yLength + 1];
      serializeValue(yDataType, yExtremeValue, valueBytes, 0);
      BytesUtils.boolToBytes(true, valueBytes, yLength);
    } else {
      valueBytes = new byte[yLength + 1 + calcTypeSize(xDataType, xResult)];
      int offset = 0;
      serializeValue(yDataType, yExtremeValue, valueBytes, offset);
      offset = yLength;

      BytesUtils.boolToBytes(false, valueBytes, offset);
      offset += 1;

      serializeValue(xDataType, xResult, valueBytes, offset);
    }
    return valueBytes;
  }
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/TableMaxMinByBaseAccumulator.java