public void initQueryDataSource(QueryDataSource dataSource) {
    dataSource.fillOrderIndexes(deviceID, orderUtils.getAscending());
    this.dataSource = dataSource;

    // updated filter concerning TTL
    // IgnoreAllNullRows is false indicating that the current query is a table model query.
    // In most cases, We can use this condition to determine from which model to obtain the ttl
    // of the current device. However, it should be noted that for tree model data queried using
    // table view, ttl also needs to be obtained from the tree model.
    if (context.isIgnoreAllNullRows() || scanOptions.isTableViewForTreeModel()) {
      if (deviceID != EMPTY_DEVICE_ID) {
        long ttl = DataNodeTTLCache.getInstance().getTTLForTree(deviceID);
        scanOptions.setTTL(ttl);
      }
    } else {
      if (scanOptions.timeFilterNeedUpdatedByTll()) {
        String databaseName = dataSource.getDatabaseName();
        long ttl =
            databaseName == null
                ? Long.MAX_VALUE
                : DataNodeTTLCache.getInstance()
                    .getTTLForTable(databaseName, deviceID.getTableName());
        scanOptions.setTTL(ttl);
      }
    }

    // init file index
    orderUtils.setCurSeqFileIndex(dataSource);
    curUnseqFileIndex = 0;
  }
Initialize the query data source. This method should be called <b>before any other methods</b>.

@param dataSource the query data source
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/SeriesScanUtil.java