public static Object[] readTabletValuesFromBuffer(
      ByteBuffer buffer, List<Integer> types, int columns, int size) {
    TSDataType[] dataTypes = new TSDataType[types.size()];
    for (int i = 0; i < dataTypes.length; i++) {
      dataTypes[i] = TSDataType.values()[types.get(i)];
    }
    return readTabletValuesFromBuffer(buffer, dataTypes, columns, size);
  }
To fetch required amounts of data and combine them through List

@param queryExecution used to get TsBlock from and judge whether there is more data.
@param fetchSize wanted row size
@return pair.left is serialized TsBlock pair.right indicates if the read finished
@throws IoTDBException IoTDBException may be thrown if error happened while getting TsBlock
    from IQueryExecution
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java