Distinguish the dsl and expr in proxy and query node (#5118)

Pass a parameter `IsExpr` from proxy to query node, so query 
node can create search plan according to the variable `IsExpr`.
It makes `segcore` unnecessary to distinguish `dsl` or `expr`
using dynamic exception. When `IsExpr` is set to true, query
node will call `CreatePlanByExpr` according to the passed
information about expression. Otherwise query node will keep
still to use `CreatePlan` according to the `dsl` information. At
the same time, this pr adds some unittests to `CreatePlanByExpr`,
these unittests translate already exist case with `dsl` to case with
`expr`.

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/5126/head
dragondriver 2021-05-07 15:20:47 +08:00 committed by GitHub
parent eed04f6c0f
commit e5d4963ba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 1439 additions and 158 deletions

View File

@ -318,19 +318,19 @@ ParsePlaceholderGroup(const Plan* plan, const std::string& blob) {
std::unique_ptr<Plan>
CreatePlan(const Schema& schema, const std::string& dsl_str) {
Json dsl;
try {
dsl = json::parse(dsl_str);
} catch (std::exception& e) {
// assume protobuf text format
proto::plan::PlanNode plan_node;
auto ok = google::protobuf::TextFormat::ParseFromString(dsl_str, &plan_node);
AssertInfo(ok, "Failed to parse");
return ProtoParser(schema).CreatePlan(plan_node);
}
dsl = json::parse(dsl_str);
auto plan = Parser(schema).CreatePlanImpl(dsl);
return plan;
}
std::unique_ptr<Plan>
CreatePlanByExpr(const Schema& schema, const std::string& serialized_expr_plan) {
proto::plan::PlanNode plan_node;
auto ok = google::protobuf::TextFormat::ParseFromString(serialized_expr_plan, &plan_node);
AssertInfo(ok, "Failed to parse");
return ProtoParser(schema).CreatePlan(plan_node);
}
std::vector<ExprPtr>
Parser::ParseItemList(const Json& body) {
std::vector<ExprPtr> results;

View File

@ -25,6 +25,9 @@ struct PlaceholderGroup;
std::unique_ptr<Plan>
CreatePlan(const Schema& schema, const std::string& dsl);
std::unique_ptr<Plan>
CreatePlanByExpr(const Schema& schema, const std::string& serialized_expr_plan);
std::unique_ptr<PlaceholderGroup>
ParsePlaceholderGroup(const Plan* plan, const std::string& placeholder_group_blob);

View File

@ -81,7 +81,6 @@ ProtoParser::PlanNodeFromProto(const planpb::PlanNode& plan_node_proto) {
// TODO: add more buffs
Assert(plan_node_proto.has_vector_anns());
auto& anns_proto = plan_node_proto.vector_anns();
AssertInfo(anns_proto.is_binary() == false, "unimplemented");
auto expr_opt = [&]() -> std::optional<ExprPtr> {
if (!anns_proto.has_predicates()) {
return std::nullopt;

View File

@ -41,6 +41,34 @@ CreatePlan(CCollection c_col, const char* dsl, CPlan* res_plan) {
}
}
CStatus
CreatePlanByExpr(CCollection c_col, const char* serialized_expr_plan, CPlan* res_plan) {
auto col = (milvus::segcore::Collection*)c_col;
try {
auto res = milvus::query::CreatePlanByExpr(*col->get_schema(), serialized_expr_plan);
auto status = CStatus();
status.error_code = Success;
status.error_msg = "";
auto plan = (CPlan)res.release();
*res_plan = plan;
return status;
} catch (milvus::SegcoreError& e) {
auto status = CStatus();
status.error_code = e.get_error_code();
status.error_msg = strdup(e.what());
*res_plan = nullptr;
return status;
} catch (std::exception& e) {
auto status = CStatus();
status.error_code = UnexpectedError;
status.error_msg = strdup(e.what());
*res_plan = nullptr;
return status;
}
}
CStatus
ParsePlaceholderGroup(CPlan c_plan,
void* placeholder_group_blob,

View File

@ -24,6 +24,9 @@ typedef void* CPlaceholderGroup;
CStatus
CreatePlan(CCollection col, const char* dsl, CPlan* res_plan);
CStatus
CreatePlanByExpr(CCollection col, const char* serialized_expr_plan, CPlan* res_plan);
CStatus
ParsePlaceholderGroup(CPlan plan,
void* placeholder_group_blob,

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,6 @@ func mGetTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg {
Timestamp: 11,
SourceID: reqID,
},
Query: nil,
ResultChannelID: "0",
}
searchMsg := &SearchMsg{

View File

@ -111,7 +111,6 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg {
Timestamp: 11,
SourceID: reqID,
},
Query: nil,
ResultChannelID: "0",
}
searchMsg := &SearchMsg{

View File

@ -127,7 +127,8 @@ message SearchRequest {
string dsl = 6;
// serialized `PlaceholderGroup`
bytes placeholder_group = 7;
common.Blob query = 8;
common.DslType dsl_type = 8;
string serialized_expr_plan = 9;
}
message SearchResults {

View File

@ -1026,11 +1026,12 @@ type SearchRequest struct {
PartitionIDs []int64 `protobuf:"varint,5,rep,packed,name=partitionIDs,proto3" json:"partitionIDs,omitempty"`
Dsl string `protobuf:"bytes,6,opt,name=dsl,proto3" json:"dsl,omitempty"`
// serialized `PlaceholderGroup`
PlaceholderGroup []byte `protobuf:"bytes,7,opt,name=placeholder_group,json=placeholderGroup,proto3" json:"placeholder_group,omitempty"`
Query *commonpb.Blob `protobuf:"bytes,8,opt,name=query,proto3" json:"query,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
PlaceholderGroup []byte `protobuf:"bytes,7,opt,name=placeholder_group,json=placeholderGroup,proto3" json:"placeholder_group,omitempty"`
DslType commonpb.DslType `protobuf:"varint,8,opt,name=dsl_type,json=dslType,proto3,enum=milvus.proto.common.DslType" json:"dsl_type,omitempty"`
SerializedExprPlan string `protobuf:"bytes,9,opt,name=serialized_expr_plan,json=serializedExprPlan,proto3" json:"serialized_expr_plan,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SearchRequest) Reset() { *m = SearchRequest{} }
@ -1107,11 +1108,18 @@ func (m *SearchRequest) GetPlaceholderGroup() []byte {
return nil
}
func (m *SearchRequest) GetQuery() *commonpb.Blob {
func (m *SearchRequest) GetDslType() commonpb.DslType {
if m != nil {
return m.Query
return m.DslType
}
return nil
return commonpb.DslType_Dsl
}
func (m *SearchRequest) GetSerializedExprPlan() string {
if m != nil {
return m.SerializedExprPlan
}
return ""
}
type SearchResults struct {
@ -1898,101 +1906,103 @@ func init() {
func init() { proto.RegisterFile("internal.proto", fileDescriptor_41f4a519b878ee3b) }
var fileDescriptor_41f4a519b878ee3b = []byte{
// 1529 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x5d, 0x6f, 0x1b, 0x45,
0x17, 0x7e, 0xd7, 0x76, 0x62, 0xfb, 0xac, 0x93, 0xba, 0xdb, 0xaf, 0x4d, 0x9b, 0xbe, 0x75, 0xf7,
0x7d, 0x81, 0x40, 0x45, 0x52, 0xa5, 0x7c, 0x89, 0x9b, 0xb6, 0x89, 0x69, 0xb0, 0xda, 0x44, 0x61,
0x9d, 0x56, 0x82, 0x9b, 0xd5, 0xd8, 0x3b, 0xb1, 0xa7, 0xdd, 0xdd, 0x71, 0x67, 0xc6, 0x4d, 0xdd,
0x2b, 0x2e, 0xb8, 0x43, 0x70, 0x81, 0xc4, 0x1f, 0xe0, 0x07, 0x70, 0xcd, 0x15, 0x20, 0xae, 0x90,
0xb8, 0x47, 0x42, 0xe2, 0x97, 0x70, 0x85, 0xe6, 0x63, 0xd7, 0x1f, 0x75, 0xd2, 0xd4, 0x50, 0x21,
0x04, 0x77, 0x3b, 0x67, 0x8e, 0xcf, 0xcc, 0xf3, 0x3c, 0xe7, 0xcc, 0x99, 0x31, 0x2c, 0x92, 0x44,
0x60, 0x96, 0xa0, 0x68, 0xb5, 0xc7, 0xa8, 0xa0, 0xce, 0x99, 0x98, 0x44, 0x8f, 0xfa, 0x5c, 0x8f,
0x56, 0xd3, 0xc9, 0xf3, 0x95, 0x36, 0x8d, 0x63, 0x9a, 0x68, 0xb3, 0xf7, 0xad, 0x05, 0x0b, 0x9b,
0x34, 0xee, 0xd1, 0x04, 0x27, 0xa2, 0x91, 0xec, 0x53, 0xe7, 0x2c, 0xcc, 0x27, 0x34, 0xc4, 0x8d,
0xba, 0x6b, 0xd5, 0xac, 0x95, 0xbc, 0x6f, 0x46, 0x8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0x0d, 0xc5, 0xf7, 0x31, 0x8a, 0x44, 0x77, 0x50, 0xb5,
0x9c, 0x0a, 0x94, 0x6e, 0xb6, 0x12, 0xca, 0x62, 0x14, 0x55, 0x73, 0x1b, 0x6f, 0x7f, 0xf4, 0x66,
0x87, 0x88, 0x6e, 0xbf, 0x25, 0x19, 0x5e, 0xd3, 0xb8, 0x5f, 0x27, 0xd4, 0x7c, 0xad, 0xa5, 0xd8,
0xd7, 0x14, 0x15, 0xd9, 0xb0, 0xd7, 0x6a, 0xcd, 0x2b, 0xcb, 0xb5, 0xdf, 0x03, 0x00, 0x00, 0xff,
0xff, 0x5d, 0xd7, 0xa3, 0x6b, 0x98, 0x14, 0x00, 0x00,
// 1563 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4b, 0x6f, 0x1b, 0xd5,
0x17, 0xff, 0x8f, 0xed, 0xc4, 0xf6, 0xb1, 0x93, 0xba, 0xd3, 0xd7, 0xa4, 0x4d, 0xff, 0x75, 0x87,
0x57, 0xa0, 0x22, 0xa9, 0x52, 0xa0, 0x88, 0x4d, 0xdb, 0xc4, 0x6d, 0xb0, 0xda, 0x44, 0x61, 0x9c,
0x56, 0x82, 0xcd, 0xe8, 0xda, 0x73, 0x62, 0x4f, 0x3b, 0x2f, 0xee, 0xbd, 0x6e, 0xe2, 0xae, 0x58,
0xb0, 0x43, 0xb0, 0x40, 0xe2, 0x0b, 0xf0, 0x01, 0xf8, 0x08, 0x80, 0x58, 0x21, 0xb1, 0x47, 0x42,
0xe2, 0x53, 0xb0, 0x64, 0x85, 0xee, 0x63, 0xc6, 0x8f, 0x3a, 0x69, 0x1a, 0xa8, 0x10, 0x82, 0xdd,
0xdc, 0x73, 0x8e, 0xcf, 0xbd, 0xe7, 0xf7, 0x3b, 0x8f, 0x7b, 0x0d, 0xf3, 0x7e, 0xc4, 0x91, 0x46,
0x24, 0x58, 0x4e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a, 0x45, 0x05, 0xc4, 0xea, 0x82, 0x7e, 0x14, 0x88, 0x87, 0xc4, 0x3a, 0xea, 0x5a, 0xaf,
0x20, 0xfe, 0xc4, 0x80, 0xca, 0x48, 0x61, 0x8a, 0x99, 0xa4, 0x07, 0x98, 0x9a, 0x7b, 0x86, 0x6c,
0xb8, 0x15, 0x2d, 0x93, 0x2d, 0xf7, 0x34, 0xcc, 0x84, 0xac, 0xab, 0x19, 0xaf, 0x3a, 0x6a, 0x61,
0x9e, 0x87, 0x52, 0xc8, 0xba, 0xf2, 0x1e, 0xa3, 0xbb, 0x74, 0xb6, 0x16, 0xb4, 0x65, 0x63, 0x4f,
0x37, 0xab, 0xa1, 0xe0, 0x8d, 0x77, 0xa1, 0x9c, 0xfd, 0x75, 0x67, 0xd6, 0xa0, 0xda, 0x8c, 0x7c,
0x2e, 0xaf, 0x2b, 0x7e, 0xd4, 0xad, 0xfd, 0xcf, 0xac, 0x40, 0xf1, 0x7d, 0x24, 0x01, 0xef, 0x0d,
0x6a, 0x86, 0x59, 0x85, 0xd2, 0xad, 0x76, 0x14, 0xd3, 0x90, 0x04, 0xb5, 0xdc, 0xda, 0xf5, 0x8f,
0xde, 0xee, 0xfa, 0xbc, 0xd7, 0x6f, 0x0b, 0x84, 0x57, 0x54, 0xdc, 0x6f, 0xfa, 0xb1, 0xfe, 0x5a,
0x49, 0x63, 0x5f, 0x91, 0x50, 0x64, 0xcb, 0xa4, 0xdd, 0x9e, 0x95, 0x92, 0x6b, 0x7f, 0x04, 0x00,
0x00, 0xff, 0xff, 0x6d, 0x31, 0x9b, 0x40, 0xd2, 0x14, 0x00, 0x00,
}

View File

@ -97,3 +97,42 @@ func TestExternalParser(t *testing.T) {
println(ast.Node.Location().Column)
}
func TestExprPlan_Str(t *testing.T) {
fields := []*schemapb.FieldSchema{
{FieldID: 100, Name: "fakevec", DataType: schemapb.DataType_FloatVector},
{FieldID: 101, Name: "age", DataType: schemapb.DataType_Int64},
}
schema := &schemapb.CollectionSchema{
Name: "default-collection",
Description: "",
AutoID: true,
Fields: fields,
}
queryInfo := &planpb.QueryInfo{
Topk: 10,
MetricType: "L2",
SearchParams: "{\"nprobe\": 10}",
}
// without filter
planProto, err := CreateQueryPlan(schema, nil, "fakevec", queryInfo)
assert.Nil(t, err)
dbgStr := proto.MarshalTextString(planProto)
println(dbgStr)
exprStrs := []string{
"age >= 420000 && age < 420010", // range
"age == 420000 || age == 420001 || age == 420002 || age == 420003 || age == 420004", // term
}
for offset, exprStr := range exprStrs {
fmt.Printf("case %d: %s\n", offset, exprStr)
planProto, err := CreateQueryPlan(schema, &exprStr, "fakevec", queryInfo)
assert.Nil(t, err)
dbgStr := proto.MarshalTextString(planProto)
println(dbgStr)
}
}

View File

@ -563,8 +563,6 @@ func (st *SearchTask) PreExecute(ctx context.Context) error {
}
st.Base.MsgType = commonpb.MsgType_Search
var dsl string
dsl = st.query.Dsl
if st.query.GetDslType() == commonpb.DslType_BoolExprV1 {
schema, err := globalMetaCache.GetCollectionSchema(ctx, collectionName)
if err != nil { // err is not nil if collection not exists
@ -606,26 +604,18 @@ func (st *SearchTask) PreExecute(ctx context.Context) error {
return errors.New("invalid expression: " + st.query.Dsl)
}
dsl = proto.MarshalTextString(plan)
st.query.Dsl = dsl
st.SearchRequest.DslType = commonpb.DslType_BoolExprV1
st.SearchRequest.SerializedExprPlan = proto.MarshalTextString(plan)
}
queryBytes, err := proto.Marshal(st.query)
if err != nil {
return err
}
st.Query = &commonpb.Blob{
Value: queryBytes,
}
st.ResultChannelID = Params.SearchResultChannelNames[0]
st.DbID = 0 // todo
st.SearchRequest.ResultChannelID = Params.SearchResultChannelNames[0]
st.SearchRequest.DbID = 0 // todo
collectionID, err := globalMetaCache.GetCollectionID(ctx, collectionName)
if err != nil { // err is not nil if collection not exists
return err
}
st.CollectionID = collectionID
st.PartitionIDs = make([]UniqueID, 0)
st.SearchRequest.CollectionID = collectionID
st.SearchRequest.PartitionIDs = make([]UniqueID, 0)
partitionsMap, err := globalMetaCache.GetPartitions(ctx, collectionName)
if err != nil {
@ -655,8 +645,8 @@ func (st *SearchTask) PreExecute(ctx context.Context) error {
}
}
st.Dsl = dsl
st.PlaceholderGroup = st.query.PlaceholderGroup
st.SearchRequest.Dsl = st.query.Dsl
st.SearchRequest.PlaceholderGroup = st.query.PlaceholderGroup
return nil
}

View File

@ -45,6 +45,21 @@ func createPlan(col Collection, dsl string) (*Plan, error) {
return newPlan, nil
}
func createPlanByExpr(col Collection, expr string) (*Plan, error) {
cExpr := C.CString(expr)
defer C.free(unsafe.Pointer(cExpr))
var cPlan C.CPlan
status := C.CreatePlanByExpr(col.collectionPtr, cExpr, &cPlan)
err1 := HandleCStatus(&status, "Create Plan by expr failed")
if err1 != nil {
return nil, err1
}
var newPlan = &Plan{cPlan: cPlan}
return newPlan, nil
}
func (plan *Plan) getTopK() int64 {
topK := C.GetTopK(plan.cPlan)
return int64(topK)

View File

@ -276,10 +276,19 @@ func (s *searchCollection) search(searchMsg *msgstream.SearchMsg) error {
if err != nil {
return err
}
dsl := searchMsg.Dsl
plan, err := createPlan(*collection, dsl)
if err != nil {
return err
var plan *Plan
if searchMsg.GetDslType() == commonpb.DslType_BoolExprV1 {
expr := searchMsg.SerializedExprPlan
plan, err = createPlanByExpr(*collection, expr)
if err != nil {
return err
}
} else {
dsl := searchMsg.Dsl
plan, err = createPlan(*collection, dsl)
if err != nil {
return err
}
}
searchRequestBlob := searchMsg.PlaceholderGroup
searchReq, err := parseSearchRequest(plan, searchRequestBlob)
@ -315,14 +324,21 @@ func (s *searchCollection) search(searchMsg *msgstream.SearchMsg) error {
searchPartitionIDs = partitionIDsInQuery
}
sp.LogFields(oplog.String("statistical time", "stats start"), oplog.Object("nq", queryNum), oplog.Object("dsl", dsl))
if searchMsg.GetDslType() == commonpb.DslType_BoolExprV1 {
sp.LogFields(oplog.String("statistical time", "stats start"),
oplog.Object("nq", queryNum),
oplog.Object("expr", searchMsg.SerializedExprPlan))
} else {
sp.LogFields(oplog.String("statistical time", "stats start"),
oplog.Object("nq", queryNum),
oplog.Object("dsl", searchMsg.Dsl))
}
for _, partitionID := range searchPartitionIDs {
segmentIDs, err := s.replica.getSegmentIDs(partitionID)
if err != nil {
return err
}
for _, segmentID := range segmentIDs {
//log.Debug("dsl = ", dsl)
segment, err := s.replica.getSegmentByID(segmentID)
if err != nil {
return err

View File

@ -101,19 +101,6 @@ func sendSearchRequest(ctx context.Context, DIM int) error {
return err
}
// generate searchRequest
searchReq := milvuspb.SearchRequest{
Dsl: dslString,
PlaceholderGroup: placeGroupByte,
}
searchReqBytes, err := proto.Marshal(&searchReq)
if err != nil {
return err
}
blob := commonpb.Blob{
Value: searchReqBytes,
}
// generate searchMsg
searchMsg := &msgstream.SearchMsg{
BaseMsg: msgstream.BaseMsg{
@ -126,8 +113,10 @@ func sendSearchRequest(ctx context.Context, DIM int) error {
Timestamp: Timestamp(10),
SourceID: 1,
},
ResultChannelID: "0",
Query: &blob,
ResultChannelID: "0",
Dsl: dslString,
PlaceholderGroup: placeGroupByte,
DslType: commonpb.DslType_Dsl,
},
}
msgPackSearch := msgstream.MsgPack{}

View File

@ -870,6 +870,8 @@ def gen_binary_index():
def gen_normal_expressions():
expressions = [
"int64 > 0",
"int64 > 0 && int64 < 2021", # range
"int64 == 0 || int64 == 1 || int64 == 2 || int64 == 3", # term
]
return expressions
@ -878,7 +880,7 @@ def get_search_param(index_type, metric_type="L2"):
search_params = {"metric_type": metric_type}
if index_type in ivf() or index_type in binary_support():
search_params.update({"nprobe": 64})
elif index_type in ["HNSW", "RHNSW_FLAT","RHNSW_SQ", "RHNSW_PQ"]:
elif index_type in ["HNSW", "RHNSW_FLAT", "RHNSW_SQ", "RHNSW_PQ"]:
search_params.update({"ef": 64})
elif index_type == "NSG":
search_params.update({"search_length": 100})