milvus/internal/proxy/reducer.go
Zhen Ye bb8d1ab3bf
enhance: make new go package to manage proto (#39114)
issue: #39095

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2025-01-10 10:49:01 +08:00

24 lines
727 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/pkg/proto/internalpb"
"github.com/milvus-io/milvus/pkg/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)
}