private void updateLongResult(long time, long yValue, Column xColumn, int xIndex) {
    if (!initResult
        || check(yValue, yExtremeValue.getLong())
        || (yValue == yExtremeValue.getLong() && time < yTimeStamp)) {
      initResult = true;
      yTimeStamp = time;
      yExtremeValue.setLong(yValue);
      updateX(xColumn, xIndex);
    }
  }
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/aggregation/MaxMinByBaseAccumulator.java