未验证 提交 95bcf3e9 编写于 作者: J Jiquan Long 提交者: GitHub

Fix error message of proto parser not clear (#26365)

Signed-off-by: Nlongjiquan <jiquan.long@zilliz.com>
上级 4aac7a66
......@@ -699,8 +699,11 @@ ProtoParser::ParseExpr(const proto::plan::Expr& expr_pb) {
case ppe::kJsonContainsExpr: {
return ParseJsonContainsExpr(expr_pb.json_contains_expr());
}
default:
PanicInfo("unsupported expr proto node");
default: {
std::string s;
google::protobuf::TextFormat::PrintToString(expr_pb, &s);
PanicInfo(std::string("unsupported expr proto node: ") + s);
}
}
}
......
......@@ -53,7 +53,8 @@ set(MILVUS_TEST_FILES
test_integer_overflow.cpp
test_offset_ordered_map.cpp
test_offset_ordered_array.cpp
test_always_true_expr.cpp)
test_always_true_expr.cpp
test_plan_proto.cpp)
if ( BUILD_DISK_ANN STREQUAL "ON" )
set(MILVUS_TEST_FILES
......
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License
#include <gtest/gtest.h>
#include <memory>
#include <regex>
#include <vector>
#include <chrono>
#include "query/PlanProto.h"
TEST(PlanProto, NotSetUnsupported) {
using namespace milvus;
using namespace milvus::query;
auto schema = std::make_shared<Schema>();
auto vec_fid = schema->AddDebugField(
"fakevec", DataType::VECTOR_FLOAT, 16, knowhere::metric::L2);
auto i64_fid = schema->AddDebugField("age", DataType::INT64);
schema->set_primary_field_id(i64_fid);
proto::plan::Expr expr_pb;
ProtoParser parser(*schema);
ASSERT_ANY_THROW(parser.ParseExpr(expr_pb));
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册