hongzhi-gao commented on code in PR #745:
URL: https://github.com/apache/tsfile/pull/745#discussion_r2980711167


##########
cpp/src/reader/qds_without_timegenerator.cc:
##########
@@ -199,4 +305,42 @@ int QDSWithoutTimeGenerator::get_next_tsblock(uint32_t 
index, bool alloc_mem) {
     return ret;
 }
 
+int QDSWithoutTimeGenerator::get_next_tsblock_with_hint(uint32_t index,
+                                                        bool alloc_mem,
+                                                        int64_t min_time_hint) 
{
+    if (tsblocks_[index] != nullptr) {
+        delete time_iters_[index];
+        time_iters_[index] = nullptr;
+        delete value_iters_[index];
+        value_iters_[index] = nullptr;
+        tsblocks_[index]->reset();
+    }
+
+    int ret = ssi_vec_[index]->get_next(tsblocks_[index], alloc_mem, nullptr,
+                                        min_time_hint);
+    if (IS_SUCC(ret)) {
+        time_iters_[index] = new ColIterator(0, tsblocks_[index]);
+        uint32_t len = 0;
+        int64_t time = *(int64_t*)(time_iters_[index]->read(&len));
+        time_iters_[index]->next();
+        heap_time_.insert(std::pair<uint64_t, uint32_t>(time, index));
+        value_iters_[index] = new ColIterator(1, tsblocks_[index]);
+    } else {
+        if (time_iters_[index]) {
+            delete time_iters_[index];
+            time_iters_[index] = nullptr;
+        }
+        if (value_iters_[index]) {
+            delete value_iters_[index];
+            value_iters_[index] = nullptr;
+        }
+        if (tsblocks_[index]) {
+            ssi_vec_[index]->destroy();
+            tsblocks_[index] = nullptr;
+        }
+        ret = E_OK;
+    }

Review Comment:
   I refined this branch to only convert E_NO_MORE_DATA to E_OK. Other failure 
codes are now preserved and propagated.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to