private boolean prepareNext(int i, Operator currentChild) throws Exception {
    if (currentChild.hasNextWithTimer()) {
      inputIndex[i] = 0;
      inputTsBlocks[i] = currentChild.nextWithTimer();
      if (!empty(i)) {
        collectTimeSeries(i);
      } else {
        // child operator has next but return an empty TsBlock which means that it may not
        // finish calculation in given time slice.
        // In such case, LastQueryMergeOperator can't go on calculating, so we just return
        // null.
        // We can also use the while loop here to continuously call the hasNext() and next()
        // methods of the child operator until its hasNext() returns false or the next() gets
        // the data that is not empty, but this will cause the execution time of the while
        // loop
        // to be uncontrollable and may exceed all allocated time slice
        return true;
      }
    } else { // no more tsBlock
      noMoreTsBlocks[i] = true;
      inputTsBlocks[i] = null;
      currentChild.close();
      children.set(i, null);
    }
    return false;
  }
prepare next batch

@return true if need to break current loop, otherwise false
@throws Exception errors happened while fetching next batch data
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/last/LastQueryMergeOperator.java