From 6d202b879d7cd47c12e97568ee85b942abf94a1d Mon Sep 17 00:00:00 2001 From: Chiara <81535309+KikiDotPy@users.noreply.github.com> Date: Wed, 6 Jul 2022 09:20:19 +0200 Subject: [PATCH 1/3] Update codec.h --- src/codec/codec.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/codec/codec.h b/src/codec/codec.h index b1f87cc47e4..27603c2790d 100644 --- a/src/codec/codec.h +++ b/src/codec/codec.h @@ -37,13 +37,11 @@ static constexpr uint8_t SIZE_LENGTH = 4; static constexpr uint8_t HEADER_LENGTH = VERSION_LENGTH + SIZE_LENGTH; static constexpr uint32_t UINT24_MAX = (1 << 24) - 1; -struct RowContext; class RowBuilder; class RowView; class RowProject; // TODO(wangtaize) share the row codec context -struct RowContext {}; class RowProject { public: From b120d110be916b2cd8a0ae98d0fa8ed8ee3954d5 Mon Sep 17 00:00:00 2001 From: Chiara <81535309+KikiDotPy@users.noreply.github.com> Date: Wed, 6 Jul 2022 09:41:39 +0200 Subject: [PATCH 2/3] Update codec.h --- src/codec/codec.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/codec/codec.h b/src/codec/codec.h index 27603c2790d..c8293f8ebcd 100644 --- a/src/codec/codec.h +++ b/src/codec/codec.h @@ -41,8 +41,6 @@ class RowBuilder; class RowView; class RowProject; -// TODO(wangtaize) share the row codec context - class RowProject { public: RowProject(const std::map>& vers_schema, const ProjectList& plist); From b6b77834db0aacea65ea3d138cefab9d243faca0 Mon Sep 17 00:00:00 2001 From: Chiara <81535309+KikiDotPy@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:00:40 +0200 Subject: [PATCH 3/3] Update schema_codec.h --- src/codec/schema_codec.h | 47 ---------------------------------------- 1 file changed, 47 deletions(-) diff --git a/src/codec/schema_codec.h b/src/codec/schema_codec.h index 30ad609e420..2d456a09634 100644 --- a/src/codec/schema_codec.h +++ b/src/codec/schema_codec.h @@ -36,9 +36,6 @@ namespace openmldb { namespace codec { -constexpr uint32_t MAX_ROW_BYTE_SIZE = 1024 * 1024; // 1M -constexpr uint32_t HEADER_BYTE_SIZE = 3; - const std::string NONETOKEN = "!N@U#L$L%"; // NOLINT const std::string EMPTY_STRING = "!@#$%"; // NOLINT const std::string DEFAULT_LONG = "1"; // NOLINT @@ -193,50 +190,6 @@ class SchemaCodec { return hybridse::type::kNull; } } - - static void GetSchemaData(const std::map& columns_map, const Schema& schema, - Schema& new_schema) { // NOLINT - for (int i = 0; i < schema.size(); i++) { - const ::openmldb::common::ColumnDesc& col = schema.Get(i); - const std::string& col_name = col.name(); - auto iter = columns_map.find(col_name); - if (iter != columns_map.end()) { - ::openmldb::common::ColumnDesc* tmp = new_schema.Add(); - tmp->CopyFrom(col); - } - } - } - - static openmldb::base::Status GetCdColumns( - const Schema& schema, const std::map& cd_columns_map, - ::google::protobuf::RepeatedPtrField<::openmldb::api::Columns>* cd_columns) { - std::map name_type_map; - for (const auto& col_desc : schema) { - name_type_map.insert(std::make_pair(col_desc.name(), col_desc.data_type())); - } - for (const auto& kv : cd_columns_map) { - auto iter = name_type_map.find(kv.first); - if (iter == name_type_map.end()) { - return openmldb::base::Status(-1, "query failed! col_name " + kv.first + " not exist"); - } - ::openmldb::api::Columns* index = cd_columns->Add(); - index->add_name(kv.first); - if (kv.second == NONETOKEN || kv.second == "null") { - continue; - } - } - return openmldb::base::Status(); - } - - private: - // calc the total size of schema - uint32_t GetSize(const std::vector& columns) { - uint32_t byte_size = 0; - for (uint32_t i = 0; i < columns.size(); i++) { - byte_size += (HEADER_BYTE_SIZE + columns[i].name.size()); - } - return byte_size; - } }; } // namespace codec