private void prepareForNextValueInCurrentColumn(
      long currentRowIndex, int startIndex, Column timeColumn, Column valueColumn) {
    if (currentRowIndex <= nextRowIndexInCurrentColumn) {
      return;
    }
    for (int i = startIndex; i < valueColumn.getPositionCount(); i++) {
      if (!timeColumn.isNull(i) && !valueColumn.isNull(i)) {
        this.nextRowIndexInCurrentColumn = currentRowIndex + (i - startIndex + 1);
        this.nextTimeInCurrentColumn = timeColumn.getLong(i);
        updateNextValueInCurrentColumn(valueColumn, i);
        return;
      }
    }

    // current column's value is not enough for filling, we should use value of next Column
    this.nextRowIndexInCurrentColumn = this.nextRowIndex;
    this.nextTimeInCurrentColumn = this.nextTime;
    updateNextValueInCurrentColumn();
  }
Whether need prepare for next.

@param rowIndex end time of current valueColumn that need to be filled
@param valueColumn valueColumn that need to be filled
@return true if valueColumn can't be filled using current information, and we need to get next
    TsBlock and then call prepareForNext. false if valueColumn can be filled using current
    information, and we can directly call fill() function
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/fill/linear/LinearFill.java