From fd6d77d62716e771c64b6f0e1eb0b7a3a7fdfed2 Mon Sep 17 00:00:00 2001 From: zhiru Date: Wed, 3 Jul 2019 17:24:36 +0800 Subject: [PATCH] update Former-commit-id: eb53fcbf6029d7c061d5c87835700b14a1213e63 --- cpp/src/db/DBImpl.cpp | 4 ++++ cpp/src/db/MySQLMetaImpl.cpp | 10 ++++++---- cpp/src/server/RequestHandler.cpp | 2 ++ cpp/src/server/RequestTask.cpp | 5 ----- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cpp/src/db/DBImpl.cpp b/cpp/src/db/DBImpl.cpp index 0a1e8651..352fcae7 100644 --- a/cpp/src/db/DBImpl.cpp +++ b/cpp/src/db/DBImpl.cpp @@ -191,6 +191,10 @@ Status DBImpl::Query(const std::string& table_id, const std::vector return status; } + for (auto& file_schema : files_array) { + ENGINE_LOG_DEBUG << "file_id: " << file_schema.file_id_; + } + if(files_array.empty()) { return Status::Error("Invalid file id"); } diff --git a/cpp/src/db/MySQLMetaImpl.cpp b/cpp/src/db/MySQLMetaImpl.cpp index f2e032da..5bef0703 100644 --- a/cpp/src/db/MySQLMetaImpl.cpp +++ b/cpp/src/db/MySQLMetaImpl.cpp @@ -1083,10 +1083,10 @@ namespace meta { // } Query getTableFileQuery = connectionPtr->query(); - getTableFileQuery << "SELECT engine_type, file_id, file_type, size, date " << - "FROM TableFiles " << - "WHERE table_id = " << quote << table_id << " AND " << - "(" << idStr << ");"; + getTableFileQuery << "SELECT id, engine_type, file_id, file_type, size, date " << + "FROM TableFiles " << + "WHERE table_id = " << quote << table_id << " AND " << + "(" << idStr << ");"; ENGINE_LOG_DEBUG << "MySQLMetaImpl::GetTableFiles: " << getTableFileQuery.str(); @@ -1106,6 +1106,8 @@ namespace meta { TableFileSchema file_schema; + file_schema.id_ = resRow["id"]; + file_schema.table_id_ = table_id; file_schema.engine_type_ = resRow["engine_type"]; diff --git a/cpp/src/server/RequestHandler.cpp b/cpp/src/server/RequestHandler.cpp index 037f80e0..a4dc182c 100644 --- a/cpp/src/server/RequestHandler.cpp +++ b/cpp/src/server/RequestHandler.cpp @@ -53,6 +53,7 @@ RequestHandler::SearchVector(std::vector &_return, const std::vector &query_record_array, const std::vector &query_range_array, const int64_t topk) { +// SERVER_LOG_DEBUG << "Entering RequestHandler::SearchVector"; BaseTaskPtr task_ptr = SearchVectorTask::Create(table_name, std::vector(), query_record_array, query_range_array, topk, _return); RequestScheduler::ExecTask(task_ptr); @@ -65,6 +66,7 @@ RequestHandler::SearchVectorInFiles(std::vector<::milvus::thrift::TopKQueryResul const std::vector<::milvus::thrift::RowRecord> &query_record_array, const std::vector<::milvus::thrift::Range> &query_range_array, const int64_t topk) { +// SERVER_LOG_DEBUG << "Entering RequestHandler::SearchVectorInFiles. file_id_array size = " << std::to_string(file_id_array.size()); BaseTaskPtr task_ptr = SearchVectorTask::Create(table_name, file_id_array, query_record_array, query_range_array, topk, _return); RequestScheduler::ExecTask(task_ptr); diff --git a/cpp/src/server/RequestTask.cpp b/cpp/src/server/RequestTask.cpp index d2c24749..1b91883a 100644 --- a/cpp/src/server/RequestTask.cpp +++ b/cpp/src/server/RequestTask.cpp @@ -482,11 +482,6 @@ ServerError SearchVectorTask::OnExecute() { engine::QueryResults results; uint64_t record_count = (uint64_t)record_array_.size(); - SERVER_LOG_DEBUG << "file_id_array_: "; - for (auto& file_id : file_id_array_) { - SERVER_LOG_DEBUG << file_id; - } - if(file_id_array_.empty()) { stat = DBWrapper::DB()->Query(table_name_, (size_t) top_k_, record_count, vec_f.data(), dates, results); } else { -- GitLab