private static Comparator<SortKey> genSingleComparator(
      boolean asc, int index, TSDataType dataType, boolean nullFirst) {

    if (index == -1) {
      return asc ? TIME_ASC_COMPARATOR : TIME_DESC_COMPARATOR;
    }
    return new SortKeyComparator(index, nullFirst, getComparator(dataType, index, asc));
  }
-1 in index is for time column.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/join/merge/MergeSortComparator.java