milvus/internal/proxy/reducer.go
Jiquan Long 6913283716
Fill output fields for count request (#27967)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
2023-10-30 10:00:12 +08:00

24 lines
737 B
Go

package proxy
import (
"context"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/proto/planpb"
)
type milvusReducer interface {
Reduce([]*internalpb.RetrieveResults) (*milvuspb.QueryResults, error)
}
func createMilvusReducer(ctx context.Context, params *queryParams, req *internalpb.RetrieveRequest, schema *schemapb.CollectionSchema, plan *planpb.PlanNode, collectionName string) milvusReducer {
if plan.GetQuery().GetIsCount() {
return &cntReducer{
collectionName: collectionName,
}
}
return newDefaultLimitReducer(ctx, params, req, schema, collectionName)
}