mirror of https://github.com/milvus-io/milvus.git
Signed-off-by: xaxys <zheng.guan@zilliz.com>
(cherry picked from commit a926a9eb66
)
pull/18244/head
parent
cb850e5540
commit
4ea7adae1d
|
@ -21,12 +21,19 @@
|
|||
|
||||
namespace milvus::query {
|
||||
|
||||
// deprecated
|
||||
std::unique_ptr<PlaceholderGroup>
|
||||
ParsePlaceholderGroup(const Plan* plan, const std::string& blob) {
|
||||
ParsePlaceholderGroup(const Plan* plan, const std::string& placeholder_group_blob) {
|
||||
return ParsePlaceholderGroup(plan, reinterpret_cast<const uint8_t*>(placeholder_group_blob.c_str()),
|
||||
placeholder_group_blob.size());
|
||||
}
|
||||
|
||||
std::unique_ptr<PlaceholderGroup>
|
||||
ParsePlaceholderGroup(const Plan* plan, const uint8_t* blob, const int64_t blob_len) {
|
||||
namespace ser = milvus::proto::common;
|
||||
auto result = std::make_unique<PlaceholderGroup>();
|
||||
ser::PlaceholderGroup ph_group;
|
||||
auto ok = ph_group.ParseFromString(blob);
|
||||
auto ok = ph_group.ParseFromArray(blob, blob_len);
|
||||
Assert(ok);
|
||||
for (auto& info : ph_group.placeholders()) {
|
||||
Placeholder element;
|
||||
|
|
|
@ -34,6 +34,10 @@ CreatePlan(const Schema& schema, const std::string& dsl);
|
|||
std::unique_ptr<Plan>
|
||||
CreateSearchPlanByExpr(const Schema& schema, const void* serialized_expr_plan, const int64_t size);
|
||||
|
||||
std::unique_ptr<PlaceholderGroup>
|
||||
ParsePlaceholderGroup(const Plan* plan, const uint8_t* blob, const int64_t blob_len);
|
||||
|
||||
// deprecated
|
||||
std::unique_ptr<PlaceholderGroup>
|
||||
ParsePlaceholderGroup(const Plan* plan, const std::string& placeholder_group_blob);
|
||||
|
||||
|
|
|
@ -77,11 +77,10 @@ ParsePlaceholderGroup(CSearchPlan c_plan,
|
|||
const void* placeholder_group_blob,
|
||||
const int64_t blob_size,
|
||||
CPlaceholderGroup* res_placeholder_group) {
|
||||
std::string blob_str((char*)placeholder_group_blob, blob_size);
|
||||
auto plan = (milvus::query::Plan*)c_plan;
|
||||
|
||||
try {
|
||||
auto res = milvus::query::ParsePlaceholderGroup(plan, blob_str);
|
||||
auto res = milvus::query::ParsePlaceholderGroup(plan, (const uint8_t*)(placeholder_group_blob), blob_size);
|
||||
|
||||
auto status = CStatus();
|
||||
status.error_code = Success;
|
||||
|
|
Loading…
Reference in New Issue