private void writeValidValuesIntoTsBlock(TsBlockBuilder builder) throws IOException {
    List<TVList> tvLists = new ArrayList<>(tvListQueryMap.keySet());
    MemPointIterator timeValuePairIterator =
        MemPointIteratorFactory.create(
            getDataType(),
            tvLists,
            deletionList,
            floatPrecision,
            encoding,
            MAX_NUMBER_OF_POINTS_IN_PAGE);

    while (timeValuePairIterator.hasNextTimeValuePair()) {
      TimeValuePair tvPair = timeValuePairIterator.nextTimeValuePair();
      builder.getTimeColumnBuilder().writeLong(tvPair.getTimestamp());
      switch (dataType) {
        case BOOLEAN:
          builder.getColumnBuilder(0).writeBoolean(tvPair.getValue().getBoolean());
          break;
        case INT32:
        case DATE:
          builder.getColumnBuilder(0).writeInt(tvPair.getValue().getInt());
          break;
        case INT64:
        case TIMESTAMP:
          builder.getColumnBuilder(0).writeLong(tvPair.getValue().getLong());
          break;
        case FLOAT:
          builder.getColumnBuilder(0).writeFloat(tvPair.getValue().getFloat());
          break;
        case DOUBLE:
          builder.getColumnBuilder(0).writeDouble(tvPair.getValue().getDouble());
          break;
        case TEXT:
        case STRING:
        case BLOB:
          builder.getColumnBuilder(0).writeBinary(tvPair.getValue().getBinary());
          break;
        default:
          break;
      }
      builder.declarePosition();
    }
  }
ReadOnlyMemChunk is a snapshot of the working MemTable and flushing memtable in the memory used
for querying.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/ReadOnlyMemChunk.java