Commit 615d1ac2 authored by Yukikaze-CZR's avatar Yukikaze-CZR
Browse files

fix build pq with empty table

parent d69e30eb
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
// under the License.

#include "server/grpc_impl/request/CreateIndexRequest.h"
#include "server/Config.h"
#include "server/DBWrapper.h"
#include "utils/Log.h"
#include "utils/TimeRecorder.h"
@@ -75,6 +76,20 @@ CreateIndexRequest::OnExecute() {
            return status;
        }

#ifdef MILVUS_GPU_VERSION
        Status s;
        bool enable_gpu = false;
        server::Config& config = server::Config::GetInstance();
        s = config.GetGpuResourceConfigEnable(enable_gpu);
        engine::meta::TableSchema table_info;
        table_info.table_id_ = table_name_;
        status = DBWrapper::DB()->DescribeTable(table_info);
        if (s.ok() && grpc_index.index_type() == (int)engine::EngineType::FAISS_PQ &&
            table_info.metric_type_ == (int)engine::MetricType::IP) {
            return Status(SERVER_UNEXPECTED_ERROR, "PQ not support IP in GPU version!");
        }
#endif

        // step 2: check table existence
        engine::TableIndex index;
        index.engine_type_ = grpc_index.index_type();