This is an automated email from the ASF dual-hosted git repository. colinlee pushed a commit to branch fix/tree-query-and-rle-decoder in repository https://gitbox.apache.org/repos/asf/tsfile.git
commit a965ceda43903d34f4944f097a33b0181faa5677 Author: ColinLee <[email protected]> AuthorDate: Wed Apr 1 18:25:54 2026 +0800 import. --- cpp/src/common/device_id.cc | 5 ++--- cpp/src/encoding/int32_rle_decoder.h | 2 +- cpp/src/file/tsfile_io_reader.cc | 9 +++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cpp/src/common/device_id.cc b/cpp/src/common/device_id.cc index 02cd3251..31ca8842 100644 --- a/cpp/src/common/device_id.cc +++ b/cpp/src/common/device_id.cc @@ -58,7 +58,7 @@ bool IDeviceIDComparator::operator()( // StringArrayDeviceID implementation StringArrayDeviceID::StringArrayDeviceID( const std::vector<std::string>& segments) - : segments_(formalize(segments)) {} + : segments_(formalize(split_device_id_string(segments))) {} StringArrayDeviceID::StringArrayDeviceID(const std::string& device_id_string) { auto segments = split_device_id_string(device_id_string); @@ -209,11 +209,10 @@ std::vector<std::string> StringArrayDeviceID::split_device_id_string( const std::string& device_id_string) { #ifdef ENABLE_ANTLR4 auto splits = storage::PathNodesGenerator::invokeParser(device_id_string); - return split_device_id_string(splits); #else auto splits = split_string(device_id_string, '.'); - return split_device_id_string(splits); #endif + return split_device_id_string(splits); } std::vector<std::string> StringArrayDeviceID::split_device_id_string( diff --git a/cpp/src/encoding/int32_rle_decoder.h b/cpp/src/encoding/int32_rle_decoder.h index aee9048a..402efa87 100644 --- a/cpp/src/encoding/int32_rle_decoder.h +++ b/cpp/src/encoding/int32_rle_decoder.h @@ -237,7 +237,7 @@ class Int32RleDecoder : public Decoder { is_length_and_bitwidth_readed_ = false; current_count_ = 0; if (current_buffer_) { - delete[] current_buffer_; + common::mem_free(current_buffer_); current_buffer_ = nullptr; } if (packer_) { diff --git a/cpp/src/file/tsfile_io_reader.cc b/cpp/src/file/tsfile_io_reader.cc index 69e12e45..6917fa31 100644 --- a/cpp/src/file/tsfile_io_reader.cc +++ b/cpp/src/file/tsfile_io_reader.cc @@ -298,17 +298,14 @@ int TsFileIOReader::load_device_index_entry( if (device_id_comparable == nullptr) { return E_INVALID_DATA_POINT; } - std::string table_name = device_id_comparable->device_id_->get_table_name(); + auto table_name = device_id_comparable->device_id_->get_table_name(); auto it = tsfile_meta_.table_metadata_index_node_map_.find(table_name); - if (it == tsfile_meta_.table_metadata_index_node_map_.end()) { + if (it == tsfile_meta_.table_metadata_index_node_map_.end() || + it->second == nullptr) { return E_DEVICE_NOT_EXIST; } auto index_node = it->second; - if (index_node == nullptr) { - return E_DEVICE_NOT_EXIST; - } if (index_node->node_type_ == LEAF_DEVICE) { - // FIXME ret = index_node->binary_search_children( device_name, true, device_index_entry, end_offset); } else {
