2023-03-16 19:31:55 +08:00
|
|
|
package proxy
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-06-09 01:28:37 +08:00
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
2023-03-16 19:31:55 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/proto/internalpb"
|
2023-05-17 16:23:23 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/proto/planpb"
|
2023-03-16 19:31:55 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
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{}
|
|
|
|
}
|
|
|
|
return newDefaultLimitReducer(ctx, params, req, schema, collectionName)
|
|
|
|
}
|