761417898 commented on code in PR #522:
URL: https://github.com/apache/tsfile/pull/522#discussion_r2163287207


##########
cpp/src/file/tsfile_io_reader.cc:
##########
@@ -529,38 +633,25 @@ int TsFileIOReader::do_load_timeseries_index(
     std::cout << "do_load_timeseries_index, reader file at " << start_offset
               << " to " << end_offset << std::endl;
 #endif
-    bool is_aligned = false;
-    AlignedTimeseriesIndex *aligned_ts_idx = nullptr;
     while (IS_SUCC(ret)) {
       TimeseriesIndex cur_timeseries_index;
       PageArena cur_timeseries_index_pa;
       cur_timeseries_index_pa.init(512, MOD_TSFILE_READER); // TODO 512
       if (RET_FAIL(cur_timeseries_index.deserialize_from(
           bs, &cur_timeseries_index_pa))) {
-      } else if (is_aligned ||
-          cur_timeseries_index.get_data_type() == common::VECTOR) {
-        if (!is_aligned) {
-          is_aligned = true;
+      } else if (is_aligned && 
cur_timeseries_index.get_measurement_name().equal_to(
+            target_measurement_name)) {
           void *buf = in_timeseries_index_pa.alloc(
               sizeof(AlignedTimeseriesIndex));
-          aligned_ts_idx = new(buf) AlignedTimeseriesIndex;
+          AlignedTimeseriesIndex * aligned_ts_idx = new(buf) 
AlignedTimeseriesIndex;
           buf = in_timeseries_index_pa.alloc(sizeof(TimeseriesIndex));

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@tsfile.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to