@Override
  public void mergeColumn(
      TsBlock[] inputTsBlocks,
      int[] inputIndex,
      int[] updatedInputIndex,
      long currentTime,
      ColumnBuilder columnBuilder) {

    // init startIndex for each input locations
    for (InputLocation inputLocation : inputLocations) {
      int tsBlockIndex = inputLocation.getTsBlockIndex();
      updatedInputIndex[tsBlockIndex] = inputIndex[tsBlockIndex];
    }

    // record whether current row already has value to be appended
    boolean appendValue = false;
    // we don't use MinHeap here to choose the right column, because inputLocations.size() won't
    // be very large.
    // Assuming inputLocations.size() will be less than 5, performance of for-loop may be better
    // than PriorityQueue.
    for (InputLocation location : inputLocations) {
      int tsBlockIndex = location.getTsBlockIndex();
      int columnIndex = location.getValueColumnIndex();
      int index = updatedInputIndex[tsBlockIndex];

      // current location's input column is not empty
      if (!ColumnMerger.empty(tsBlockIndex, inputTsBlocks, updatedInputIndex)) {
        Column timeColumn = inputTsBlocks[tsBlockIndex].getTimeColumn();
        Column valueColumn = inputTsBlocks[tsBlockIndex].getColumn(columnIndex);
        // time of current location's input column is equal to current row's time
        if (timeColumn.getLong(index) == currentTime) {
          // value of current location's input column is not null
          // here we only append value if there is no value appended before and current value is
          // null
          // belonging to more than one DataRegion, we need to choose which one is latest
          if (!appendValue && !valueColumn.isNull(index)) {
            columnBuilder.write(valueColumn, index);
            appendValue = true;
          }
          // increase the index
          index++;
          // update the index after merging
          updatedInputIndex[tsBlockIndex] = index;
        }
      }
    }
    // all input columns are null at current row, so just append a null
    if (!appendValue) {
      columnBuilder.appendNull();
    }
  }
has more than one input column, but these columns' time is overlapped.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/join/merge/MultiColumnMerger.java