You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tsfile.apache.org by "hongzhi-gao (via GitHub)" <gi...@apache.org> on 2026/03/17 07:16:30 UTC

[PR] Feature/query by row [tsfile]

hongzhi-gao opened a new pull request, #745:
URL: https://github.com/apache/tsfile/pull/745

   # PR: Query by Row (OFFSET/LIMIT) for Tree and Table Model
   
   ## Summary
   
   Add `queryByRow(paths/table, offset, limit)` for both tree and table model. Results are equivalent to “full query then skip first `offset` rows and take at most `limit` rows,” but offset/limit are pushed down so that Chunk/Page-level skipping avoids decoding unnecessary data where possible.
   
   ## Changes
   
   ### Tree model
   - **API**: `TsFileReader::queryByRow(path_list, offset, limit)` / `TsFileTreeReader::queryByRow(devices, measurements, offset, limit)`.
   - **Pushdown**: Single-path: `set_row_range(offset, limit)` on SSI → Chunk/Page skipped by count. Multi-path: offset/limit applied in merge loop; `min_time_hint` used to skip stale Chunks.
   - **Tests**: Correctness (no offset/limit, offset only, limit only, offset+limit, boundaries, multi-path merge) + **QueryByRowFasterThanManualNext** (timing: queryByRow faster than full query + manual next, 5% tolerance).
   
   ### Table model
   - **API**: `TsFileReader::queryByRow(table_name, column_names, offset, limit)`.
   - **Pushdown**:  
     - Device: skip whole device when `remaining_offset >= device_row_count` (Dense (in this codebase) means: within one device, every queried column has the same number of rows and the same timestamps.).  
     - SSI: when dense, `set_row_range(offset, limit)` on each column’s SSI → Chunk/Page skip by count.  
     - TsBlock: when sparse or not fully consumed at SSI, offset/limit applied in merge loop.
   - **Tests**: Correctness (single/multi device, offset/limit, boundaries, equivalence with manual skip, SSI-level pushdown) + **QueryByRowFasterThanManualNext** (same timing check as tree).
   
   ## Review focus
   
   - **Semantics**: queryByRow(offset, limit) matches “full query + skip offset + take limit” (existing equivalence tests).
   - **Performance**: New timing tests require queryByRow to be no slower than manual next within 5% (min of 5 runs); confirms pushdown is used in practice.
   


-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "hongzhi-gao (via GitHub)" <gi...@apache.org>.
hongzhi-gao commented on code in PR #745:
URL: https://github.com/apache/tsfile/pull/745#discussion_r2980713508


##########
cpp/src/reader/table_query_executor.cc:
##########
@@ -88,6 +88,73 @@ int TableQueryExecutor::query(const std::string& table_name,
     return ret;
 }
 
+int TableQueryExecutor::query(const std::string& table_name,
+                              const std::vector<std::string>& columns,
+                              Filter* time_filter, Filter* id_filter,
+                              Filter* field_filter, int offset, int limit,
+                              ResultSet*& ret_qds) {
+    int ret = common::E_OK;
+    TsFileMeta* file_metadata = nullptr;
+    file_metadata = tsfile_io_reader_->get_tsfile_meta();
+    common::PageArena pa;
+    pa.init(512, common::MOD_TSFILE_READER);
+    MetaIndexNode* table_root = nullptr;
+    std::shared_ptr<TableSchema> table_schema;
+    if (RET_FAIL(
+            file_metadata->get_table_metaindex_node(table_name, table_root))) {
+    } else if (RET_FAIL(
+                   file_metadata->get_table_schema(table_name, table_schema))) {
+    }
+
+    if (IS_FAIL(ret)) {
+        ret_qds = nullptr;
+        return ret;
+    }
+    std::vector<std::string> lower_case_column_names(columns);
+    for (auto& column : lower_case_column_names) {
+        to_lowercase_inplace(column);
+    }
+    std::shared_ptr<ColumnMapping> column_mapping =
+        std::make_shared<ColumnMapping>();
+    for (size_t i = 0; i < lower_case_column_names.size(); ++i) {
+        column_mapping->add(lower_case_column_names[i], static_cast<int>(i),
+                            *table_schema);
+    }
+    std::vector<common::TSDataType> data_types;
+    data_types.reserve(lower_case_column_names.size());
+    for (size_t i = 0; i < lower_case_column_names.size(); ++i) {
+        auto ind = table_schema->find_column_index(lower_case_column_names[i]);
+        if (ind < 0) {
+            delete time_filter;

Review Comment:
   I removed the delete there, since this layer should not own/free time_filter in that path.



-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 commented on code in PR #745:
URL: https://github.com/apache/tsfile/pull/745#discussion_r2972614493


##########
cpp/src/reader/qds_without_timegenerator.cc:
##########
@@ -111,37 +143,111 @@ void QDSWithoutTimeGenerator::close() {
 }
 
 int QDSWithoutTimeGenerator::next(bool& has_next) {
-    row_record_->reset();
-    if (heap_time_.size() == 0) {
-        has_next = false;
-        return E_OK;
+    // For single path, apply offset/limit at row level.
+    if (is_single_path_) {
+        while (true) {
+            row_record_->reset();
+            if (heap_time_.size() == 0) {
+                has_next = false;
+                return E_OK;
+            }
+            if (remaining_limit_ == 0) {
+                has_next = false;
+                return E_OK;
+            }
+            int64_t time = heap_time_.begin()->first;
+            row_record_->set_timestamp(time);
+            row_record_->get_field(0)->set_value(INT64, &time, get_len(INT64),
+                                                 pa_);
+
+            uint32_t len = 0;
+            uint32_t idx = heap_time_.begin()->second;
+            auto val_datatype = value_iters_[idx]->get_data_type();
+            void* val_ptr = value_iters_[idx]->read(&len);
+            row_record_->get_field(idx + 1)->set_value(val_datatype, val_ptr,
+                                                       len, pa_);
+            value_iters_[idx]->next();
+
+            heap_time_.erase(heap_time_.begin());
+
+            if (!time_iters_[idx]->end()) {
+                int64_t timev = *(int64_t*)(time_iters_[idx]->read(&len));
+                heap_time_.insert(std::make_pair(timev, idx));
+                time_iters_[idx]->next();
+            } else {
+                get_next_tsblock(idx, false);
+            }
+
+            // Apply offset: skip this row.
+            if (remaining_offset_ > 0) {
+                remaining_offset_--;
+                continue;
+            }

Review Comment:
   May skip setting row_record's field if offset > 0.



##########
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:
   The failure status cannot be sensed in this branch. Is this safe?



##########
cpp/src/reader/tsfile_reader.cc:
##########
@@ -116,6 +114,41 @@ int TsFileReader::query(const std::string& table_name,
     return ret;
 }
 
+int TsFileReader::queryByRow(std::vector<std::string>& path_list, int offset,
+                             int limit, ResultSet*& result_set) {
+    int ret = E_OK;
+    std::vector<Path> path_list_vec;
+    for (const auto& path : path_list) {
+        path_list_vec.emplace_back(Path(path, true));
+    }
+    QueryExpression* query_expression =
+        QueryExpression::create(path_list_vec, nullptr);
+    ret =
+        tsfile_executor_->execute(query_expression, result_set, offset, limit);
+    return ret;
+}
+
+int TsFileReader::queryByRow(const std::string& table_name,
+                             const std::vector<std::string>& column_names,
+                             int offset, int limit, ResultSet*& result_set) {
+    int ret = E_OK;
+    TsFileMeta* tsfile_meta = tsfile_executor_->get_tsfile_meta();
+    if (tsfile_meta == nullptr) {
+        return E_TSFILE_WRITER_META_ERR;

Review Comment:
   TSFILE_WRITER ?



##########
cpp/src/reader/tsfile_series_scan_iterator.cc:
##########
@@ -36,52 +36,103 @@ void TsFileSeriesScanIterator::destroy() {
     }
 }
 
+bool TsFileSeriesScanIterator::should_skip_chunk_by_time(
+    ChunkMeta* cm, int64_t min_time_hint) {
+    if (min_time_hint < 0 || cm->statistic_ == nullptr) {

Review Comment:
   Beware of negative timestamp



##########
cpp/src/reader/table_query_executor.cc:
##########
@@ -88,6 +88,73 @@ int TableQueryExecutor::query(const std::string& table_name,
     return ret;
 }
 
+int TableQueryExecutor::query(const std::string& table_name,
+                              const std::vector<std::string>& columns,
+                              Filter* time_filter, Filter* id_filter,

Review Comment:
   id_filter -> tag_filter



##########
cpp/src/reader/chunk_reader.cc:
##########
@@ -490,4 +504,82 @@ int ChunkReader::decode_tv_buf_into_tsblock_by_datatype(ByteStream& time_in,
     return ret;
 }
 
+bool ChunkReader::should_skip_page_by_time(int64_t min_time_hint) {
+    if (min_time_hint < 0) {
+        return false;
+    }

Review Comment:
   Though rare, the timestamp can be negative.
   May use the minimum of int64 for this case.



##########
cpp/src/reader/table_query_executor.cc:
##########
@@ -88,6 +88,73 @@ int TableQueryExecutor::query(const std::string& table_name,
     return ret;
 }
 
+int TableQueryExecutor::query(const std::string& table_name,
+                              const std::vector<std::string>& columns,
+                              Filter* time_filter, Filter* id_filter,
+                              Filter* field_filter, int offset, int limit,
+                              ResultSet*& ret_qds) {
+    int ret = common::E_OK;
+    TsFileMeta* file_metadata = nullptr;
+    file_metadata = tsfile_io_reader_->get_tsfile_meta();
+    common::PageArena pa;
+    pa.init(512, common::MOD_TSFILE_READER);
+    MetaIndexNode* table_root = nullptr;
+    std::shared_ptr<TableSchema> table_schema;
+    if (RET_FAIL(
+            file_metadata->get_table_metaindex_node(table_name, table_root))) {
+    } else if (RET_FAIL(
+                   file_metadata->get_table_schema(table_name, table_schema))) {
+    }
+
+    if (IS_FAIL(ret)) {
+        ret_qds = nullptr;
+        return ret;
+    }
+    std::vector<std::string> lower_case_column_names(columns);
+    for (auto& column : lower_case_column_names) {
+        to_lowercase_inplace(column);
+    }
+    std::shared_ptr<ColumnMapping> column_mapping =
+        std::make_shared<ColumnMapping>();
+    for (size_t i = 0; i < lower_case_column_names.size(); ++i) {
+        column_mapping->add(lower_case_column_names[i], static_cast<int>(i),
+                            *table_schema);
+    }
+    std::vector<common::TSDataType> data_types;
+    data_types.reserve(lower_case_column_names.size());
+    for (size_t i = 0; i < lower_case_column_names.size(); ++i) {
+        auto ind = table_schema->find_column_index(lower_case_column_names[i]);
+        if (ind < 0) {
+            delete time_filter;

Review Comment:
   Why is time_filter deleted here?



-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "hongzhi-gao (via GitHub)" <gi...@apache.org>.
hongzhi-gao commented on code in PR #745:
URL: https://github.com/apache/tsfile/pull/745#discussion_r2980714942


##########
cpp/src/reader/table_query_executor.cc:
##########
@@ -88,6 +88,73 @@ int TableQueryExecutor::query(const std::string& table_name,
     return ret;
 }
 
+int TableQueryExecutor::query(const std::string& table_name,
+                              const std::vector<std::string>& columns,
+                              Filter* time_filter, Filter* id_filter,

Review Comment:
   I renamed id_filter to tag_filter in the query interfaces and corresponding usages for consistency.



-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "hongzhi-gao (via GitHub)" <gi...@apache.org>.
hongzhi-gao closed pull request #745: Feature/query by row
URL: https://github.com/apache/tsfile/pull/745


-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "hongzhi-gao (via GitHub)" <gi...@apache.org>.
hongzhi-gao commented on code in PR #745:
URL: https://github.com/apache/tsfile/pull/745#discussion_r2980697038


##########
cpp/src/reader/chunk_reader.cc:
##########
@@ -490,4 +504,82 @@ int ChunkReader::decode_tv_buf_into_tsblock_by_datatype(ByteStream& time_in,
     return ret;
 }
 
+bool ChunkReader::should_skip_page_by_time(int64_t min_time_hint) {
+    if (min_time_hint < 0) {
+        return false;
+    }

Review Comment:
   I changed the min_time_hint sentinel logic to use INT64_MIN instead of checking < 0, so negative timestamps are handled correctly.



-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "hongzhi-gao (via GitHub)" <gi...@apache.org>.
hongzhi-gao commented on PR #745:
URL: https://github.com/apache/tsfile/pull/745#issuecomment-4122923585

   > May also add in C and Python.
   
   Done


-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "hongzhi-gao (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "hongzhi-gao (via GitHub)" <gi...@apache.org>.
hongzhi-gao commented on code in PR #745:
URL: https://github.com/apache/tsfile/pull/745#discussion_r2980719617


##########
cpp/src/reader/tsfile_series_scan_iterator.cc:
##########
@@ -36,52 +36,103 @@ void TsFileSeriesScanIterator::destroy() {
     }
 }
 
+bool TsFileSeriesScanIterator::should_skip_chunk_by_time(
+    ChunkMeta* cm, int64_t min_time_hint) {
+    if (min_time_hint < 0 || cm->statistic_ == nullptr) {

Review Comment:
   I switched to INT64_MIN sentinel handling here as well, so negative timestamps are not treated as an invalid hint.



-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "hongzhi-gao (via GitHub)" <gi...@apache.org>.
hongzhi-gao commented on code in PR #745:
URL: https://github.com/apache/tsfile/pull/745#discussion_r2980705799


##########
cpp/src/reader/qds_without_timegenerator.cc:
##########
@@ -111,37 +143,111 @@ void QDSWithoutTimeGenerator::close() {
 }
 
 int QDSWithoutTimeGenerator::next(bool& has_next) {
-    row_record_->reset();
-    if (heap_time_.size() == 0) {
-        has_next = false;
-        return E_OK;
+    // For single path, apply offset/limit at row level.
+    if (is_single_path_) {
+        while (true) {
+            row_record_->reset();
+            if (heap_time_.size() == 0) {
+                has_next = false;
+                return E_OK;
+            }
+            if (remaining_limit_ == 0) {
+                has_next = false;
+                return E_OK;
+            }
+            int64_t time = heap_time_.begin()->first;
+            row_record_->set_timestamp(time);
+            row_record_->get_field(0)->set_value(INT64, &time, get_len(INT64),
+                                                 pa_);
+
+            uint32_t len = 0;
+            uint32_t idx = heap_time_.begin()->second;
+            auto val_datatype = value_iters_[idx]->get_data_type();
+            void* val_ptr = value_iters_[idx]->read(&len);
+            row_record_->get_field(idx + 1)->set_value(val_datatype, val_ptr,
+                                                       len, pa_);
+            value_iters_[idx]->next();
+
+            heap_time_.erase(heap_time_.begin());
+
+            if (!time_iters_[idx]->end()) {
+                int64_t timev = *(int64_t*)(time_iters_[idx]->read(&len));
+                heap_time_.insert(std::make_pair(timev, idx));
+                time_iters_[idx]->next();
+            } else {
+                get_next_tsblock(idx, false);
+            }
+
+            // Apply offset: skip this row.
+            if (remaining_offset_ > 0) {
+                remaining_offset_--;
+                continue;
+            }

Review Comment:
   I updated the flow to skip populating row_record fields when offset is still pending, while still advancing iterators/heap state correctly.



-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "hongzhi-gao (via GitHub)" <gi...@apache.org>.
hongzhi-gao commented on code in PR #745:
URL: https://github.com/apache/tsfile/pull/745#discussion_r2980716271


##########
cpp/src/reader/tsfile_reader.cc:
##########
@@ -116,6 +114,41 @@ int TsFileReader::query(const std::string& table_name,
     return ret;
 }
 
+int TsFileReader::queryByRow(std::vector<std::string>& path_list, int offset,
+                             int limit, ResultSet*& result_set) {
+    int ret = E_OK;
+    std::vector<Path> path_list_vec;
+    for (const auto& path : path_list) {
+        path_list_vec.emplace_back(Path(path, true));
+    }
+    QueryExpression* query_expression =
+        QueryExpression::create(path_list_vec, nullptr);
+    ret =
+        tsfile_executor_->execute(query_expression, result_set, offset, limit);
+    return ret;
+}
+
+int TsFileReader::queryByRow(const std::string& table_name,
+                             const std::vector<std::string>& column_names,
+                             int offset, int limit, ResultSet*& result_set) {
+    int ret = E_OK;
+    TsFileMeta* tsfile_meta = tsfile_executor_->get_tsfile_meta();
+    if (tsfile_meta == nullptr) {
+        return E_TSFILE_WRITER_META_ERR;

Review Comment:
   I replaced the reader-side null-meta return code with E_FILE_READ_ERR instead of E_TSFILE_WRITER_META_ERR.



-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 commented on code in PR #745:
URL: https://github.com/apache/tsfile/pull/745#discussion_r2985528919


##########
cpp/src/reader/table_query_executor.cc:
##########
@@ -88,6 +88,73 @@ int TableQueryExecutor::query(const std::string& table_name,
     return ret;
 }
 
+int TableQueryExecutor::query(const std::string& table_name,
+                              const std::vector<std::string>& columns,
+                              Filter* time_filter, Filter* id_filter,
+                              Filter* field_filter, int offset, int limit,
+                              ResultSet*& ret_qds) {
+    int ret = common::E_OK;
+    TsFileMeta* file_metadata = nullptr;
+    file_metadata = tsfile_io_reader_->get_tsfile_meta();
+    common::PageArena pa;
+    pa.init(512, common::MOD_TSFILE_READER);
+    MetaIndexNode* table_root = nullptr;
+    std::shared_ptr<TableSchema> table_schema;
+    if (RET_FAIL(
+            file_metadata->get_table_metaindex_node(table_name, table_root))) {
+    } else if (RET_FAIL(
+                   file_metadata->get_table_schema(table_name, table_schema))) {
+    }
+
+    if (IS_FAIL(ret)) {
+        ret_qds = nullptr;
+        return ret;
+    }
+    std::vector<std::string> lower_case_column_names(columns);
+    for (auto& column : lower_case_column_names) {
+        to_lowercase_inplace(column);
+    }
+    std::shared_ptr<ColumnMapping> column_mapping =
+        std::make_shared<ColumnMapping>();
+    for (size_t i = 0; i < lower_case_column_names.size(); ++i) {
+        column_mapping->add(lower_case_column_names[i], static_cast<int>(i),
+                            *table_schema);
+    }
+    std::vector<common::TSDataType> data_types;
+    data_types.reserve(lower_case_column_names.size());
+    for (size_t i = 0; i < lower_case_column_names.size(); ++i) {
+        auto ind = table_schema->find_column_index(lower_case_column_names[i]);
+        if (ind < 0) {
+            delete time_filter;

Review Comment:
   Double-check this, instead of removing the delete, more deletes are even added.



-- 
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-unsubscribe@tsfile.apache.org

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


Re: [PR] Feature/query by row [tsfile]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 merged PR #745:
URL: https://github.com/apache/tsfile/pull/745


-- 
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-unsubscribe@tsfile.apache.org

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