public static Map<IFullPath, List<TimeValuePair>> getDataByQuery(
      List<IFullPath> fullPaths,
      List<TsFileResource> sequenceResources,
      List<TsFileResource> unsequenceResources,
      boolean clearCacheDuringQuery)
      throws IllegalPathException, IOException {
    Map<IFullPath, List<TimeValuePair>> pathDataMap = new HashMap<>();
    FileReaderManager.getInstance().closeAndRemoveAllOpenedReaders();
    clearCache();
    for (int i = 0; i < fullPaths.size(); ++i) {
      IFullPath path = fullPaths.get(i);
      List<TimeValuePair> dataList = new ArrayList<>();

      IDataBlockReader reader =
          new SeriesDataBlockReader(
              path,
              FragmentInstanceContext.createFragmentInstanceContextForCompaction(TEST_QUERY_JOB_ID),
              sequenceResources,
              unsequenceResources,
              true);
      while (reader.hasNextBatch()) {
        TsBlock batchData = reader.nextBatch();
        IPointReader pointReader;
        if (path instanceof AlignedPath) {
          pointReader = batchData.getTsBlockAlignedRowIterator();
        } else {
          pointReader = batchData.getTsBlockSingleColumnIterator();
        }
        while (pointReader.hasNextTimeValuePair()) {
          dataList.add(pointReader.nextTimeValuePair());
        }
      }
      pathDataMap.put(fullPaths.get(i), dataList);

      if (clearCacheDuringQuery) {
        clearCache();
      }
    }
    FileReaderManager.getInstance().closeAndRemoveAllOpenedReaders();
    return pathDataMap;
  }
Using SeriesRawDataBatchReader to read raw data from files, and return it as a map.

@param fullPaths
@param sequenceResources
@param unsequenceResources
@return
@throws IOException
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionCheckerUtils.java