@SuppressWarnings("squid:S3776")
  public void next() throws IllegalPathException, IOException, WriteProcessException {
    if (currentPointElement != null) {

      if (currentPointElement.hasNext()) {
        // get the point directly if it is not overlapped with other points
        currentPoint = currentPointElement.next();
        if (currentPoint.getTimestamp() >= nextPointInOtherPage) {
          // if the point is overlapped with other points, then add it into priority queue
          pointQueue.add(currentPointElement);
          currentPointElement = null;
        }
      } else {
        // end page
        PageElement pageElement = currentPointElement.pageElement;
        currentPointElement = null;
        removePage.call(pageElement);
      }
    } else {
      // remove data points with the same timestamp as the last point
      while (!pointQueue.isEmpty() && pointQueue.peek().timestamp == lastTime) {
        // find the data points in other pages that has the same timestamp
        PointElement pointElement = pointQueue.poll();
        if (pointElement.hasNext()) {
          pointElement.next();
          nextPointInOtherPage =
              !pointQueue.isEmpty() ? pointQueue.peek().timestamp : Long.MAX_VALUE;
          if (pointElement.timestamp < nextPointInOtherPage) {
            currentPointElement = pointElement;
            currentPoint = currentPointElement.timeValuePair;
          } else {
            pointQueue.add(pointElement);
          }
        } else {
          // end page
          removePage.call(pointElement.pageElement);
        }
      }
    }
  }
Use those records that share the same timestamp to fill the null sub sensor value in current
TimeValuePair.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/reader/PointPriorityReader.java