private static AbstractAlignedTimeSeriesMetadata loadAlignedTimeSeriesMetadataFromDisk(
      TsFileResource resource,
      AlignedFullPath alignedPath,
      FragmentInstanceContext context,
      Filter globalTimeFilter,
      boolean ignoreAllNullRows)
      throws IOException {
    AbstractAlignedTimeSeriesMetadata alignedTimeSeriesMetadata = null;
    // load all the TimeseriesMetadata of vector, the first one is for time column and the
    // remaining is for sub sensors
    // the order of timeSeriesMetadata list is same as subSensorList's order
    TimeSeriesMetadataCache cache = TimeSeriesMetadataCache.getInstance();
    List<String> valueMeasurementList = alignedPath.getMeasurementList();
    Set<String> allSensors = alignedPath.getAllSensors();
    boolean isDebug = context.isDebug();
    String filePath = resource.getTsFilePath();
    IDeviceID deviceId = alignedPath.getDeviceId();

    // when resource.getTimeIndexType() == 1, TsFileResource.timeIndexType is deviceTimeIndex
    // we should not ignore the non-exist of device in TsFileMetadata
    TimeseriesMetadata timeColumn =
        cache.get(
            filePath,
            new TimeSeriesMetadataCacheKey(resource.getTsFileID(), deviceId, ""),
            allSensors,
            context.ignoreNotExistsDevice()
                || resource.getTimeIndexType() == ITimeIndex.FILE_TIME_INDEX_TYPE,
            isDebug,
            context);
    if (timeColumn != null) {
      // only need time column, like count_time aggregation
      if (valueMeasurementList.isEmpty()) {
        // whatever for table or tree model, if we only need time column, that means that we
        // shouldn't ignore all null rows
        alignedTimeSeriesMetadata =
            setModifications(
                resource,
                timeColumn,
                Collections.emptyList(),
                alignedPath,
                context,
                globalTimeFilter,
                false);
      } else {
        List<TimeseriesMetadata> valueTimeSeriesMetadataList =
            new ArrayList<>(valueMeasurementList.size());
        // if all the queried aligned sensors does not exist, we will return null
        boolean exist = false;
        for (String valueMeasurement : valueMeasurementList) {
          TimeseriesMetadata valueColumn =
              cache.get(
                  filePath,
                  new TimeSeriesMetadataCacheKey(
                      resource.getTsFileID(), deviceId, valueMeasurement),
                  allSensors,
                  context.ignoreNotExistsDevice()
                      || resource.getTimeIndexType() == ITimeIndex.FILE_TIME_INDEX_TYPE,
                  isDebug,
                  context);
          exist = (exist || (valueColumn != null));
          valueTimeSeriesMetadataList.add(valueColumn);
        }
        if (!ignoreAllNullRows || exist) {
          alignedTimeSeriesMetadata =
              setModifications(
                  resource,
                  timeColumn,
                  valueTimeSeriesMetadataList,
                  alignedPath,
                  context,
                  globalTimeFilter,
                  ignoreAllNullRows);
        }
      }
    }
    return alignedTimeSeriesMetadata;
  }
Load AlignedTimeSeriesMetadata for aligned time series.

@param resource corresponding TsFileResource
@param alignedPath instance of VectorPartialPath, vector's full path, e.g. (root.sg1.d1.vector,
    [root.sg1.d1.vector.s1, root.sg1.d1.vector.s2])
@throws IOException IOException may be thrown while reading it from disk.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/FileLoaderUtils.java