milvus/internal/proxy/reducer_test.go
Jiquan Long 8139106b51
Feat: count entities by expression (#22765)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
2023-03-16 19:31:55 +08:00

29 lines
582 B
Go

package proxy
import (
"testing"
"github.com/milvus-io/milvus/internal/proto/planpb"
"github.com/stretchr/testify/assert"
)
func Test_createMilvusReducer(t *testing.T) {
n := &planpb.PlanNode{
Node: &planpb.PlanNode_Query{
Query: &planpb.QueryPlanNode{
IsCount: false,
},
},
}
var r milvusReducer
r = createMilvusReducer(nil, nil, nil, nil, n, "")
_, ok := r.(*defaultLimitReducer)
assert.True(t, ok)
n.Node.(*planpb.PlanNode_Query).Query.IsCount = true
r = createMilvusReducer(nil, nil, nil, nil, n, "")
_, ok = r.(*cntReducer)
assert.True(t, ok)
}