From 9384bfdc2888867b4d9d2166f60a2d919acd54c6 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Fri, 20 Oct 2017 12:29:00 +0300 Subject: [PATCH] fix invalid catboost model handle [#CLICKHOUSE-3305] --- dbms/src/Dictionaries/CatBoostModel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbms/src/Dictionaries/CatBoostModel.cpp b/dbms/src/Dictionaries/CatBoostModel.cpp index 83ae29bd046..412cdc1a923 100644 --- a/dbms/src/Dictionaries/CatBoostModel.cpp +++ b/dbms/src/Dictionaries/CatBoostModel.cpp @@ -82,7 +82,7 @@ public: std::string msg = "Cannot create CatBoost model: "; throw Exception(msg + api->GetErrorString(), ErrorCodes::CANNOT_LOAD_CATBOOST_MODEL); } - if (!api->LoadFullModelFromFile(handle_.get(), model_path.c_str())) + if (!api->LoadFullModelFromFile(handle_->get(), model_path.c_str())) { std::string msg = "Cannot load CatBoost model: "; throw Exception(msg + api->GetErrorString(), ErrorCodes::CANNOT_LOAD_CATBOOST_MODEL); @@ -316,7 +316,7 @@ private: if (cat_features_count == 0) { - if (!api->CalcModelPredictionFlat(handle.get(), column_size, + if (!api->CalcModelPredictionFlat(handle->get(), column_size, float_features_buf, float_features_count, result_buf, column_size)) { @@ -337,7 +337,7 @@ private: auto fixed_strings_data = placeStringColumns(columns, float_features_count, cat_features_count, cat_features_buf); - if (!api->CalcModelPrediction(handle.get(), column_size, + if (!api->CalcModelPrediction(handle->get(), column_size, float_features_buf, float_features_count, cat_features_buf, cat_features_count, result_buf, column_size)) @@ -353,7 +353,7 @@ private: cat_features_count, cat_features_buf); calcHashes(columns, float_features_count, cat_features_count, cat_features_buf); if (!api->CalcModelPredictionWithHashedCatFeatures( - handle.get(), column_size, + handle->get(), column_size, float_features_buf, float_features_count, cat_features_buf, cat_features_count, result_buf, column_size))