Closed ThreadDao closed 5 months ago
case:
func TestQueryIteratorDefault(t *testing.T) { ctx := createContext(t, time.Second*common.DefaultTimeout) // connect mc := createMilvusClient(ctx, t) // create collection cp := CollectionParams{CollectionFieldsType: Int64FloatVec, AutoID: false, EnableDynamicField: true, ShardsNum: common.DefaultShards, Dim: common.DefaultDim} collName := createCollection(ctx, t, mc, cp) // insert dp := DataParams{CollectionName: collName, PartitionName: "", CollectionFieldsType: Int64FloatVec, start: 0, nb: common.DefaultNb, dim: common.DefaultDim, EnableDynamicField: true, WithRows: false} _, _ = insertData(ctx, t, mc, dp) idx, _ := entity.NewIndexHNSW(entity.L2, 8, 96) _ = mc.CreateIndex(ctx, collName, common.DefaultFloatVecFieldName, idx, false) // Load collection errLoad := mc.LoadCollection(ctx, collName, false) common.CheckErr(t, errLoad, true) // query iterator with default batch itr, err := mc.QueryIterator(ctx, client.NewQueryIteratorOption(collName).WithExpr("int64 < 100")) common.CheckErr(t, err, true) for { rs, err := itr.Next(ctx) if err != nil { log.Println(err) break } for _, col := range rs { if col.Name() == common.DefaultIntFieldName { idColumn := col.(*entity.ColumnInt64).Data() log.Println(idColumn) } } } }
2024/05/31 15:30:50 milvus_client.go:14: (ApiRequest): func [NewDefaultGrpcClient], args: [context.Background.WithDeadline(2024-05-31 15:32:50.476176608 +0800 CST m=+120.004301473 [1m59.999966354s]) 10.104.6.223:19530] 2024/05/31 15:30:50 milvus_client.go:21: (ApiResponse): func [NewDefaultGrpcClient], results: [0xc000290880] 2024/05/31 15:30:50 milvus_client.go:14: (ApiRequest): func [CreateCollection], args: [context.Background.WithDeadline(2024-05-31 15:32:50.476176608 +0800 CST m=+120.004301473 [1m59.975673437s]) BizI 0xc000138fa0 2 []] 2024/05/31 15:30:50 milvus_client.go:21: (ApiResponse): func [CreateCollection], results: [] 2024/05/31 15:30:50 milvus_client.go:14: (ApiRequest): func [Insert], args: [context.Background.WithDeadline(2024-05-31 15:32:50.476176608 +0800 CST m=+120.004301473 [1m59.935169409s]) BizI [0xc000400540 0xc000400570 0xc000400000 0xc000400090 0xc0004000c0 0xc0004000f0]] 2024/05/31 15:30:50 milvus_client.go:21: (ApiResponse): func [Insert], results: [0xc000678030] 2024/05/31 15:30:50 milvus_client.go:14: (ApiRequest): func [CreateIndex], args: [context.Background.WithDeadline(2024-05-31 15:32:50.476176608 +0800 CST m=+120.004301473 [1m59.635757686s]) BizI floatVec false 0xc000418060 []] 2024/05/31 15:30:50 milvus_client.go:21: (ApiResponse): func [CreateIndex], results: [] 2024/05/31 15:30:50 milvus_client.go:14: (ApiRequest): func [LoadCollection], args: [context.Background.WithDeadline(2024-05-31 15:32:50.476176608 +0800 CST m=+120.004301473 [1m59.599955439s]) BizI []] 2024/05/31 15:30:52 milvus_client.go:21: (ApiResponse): func [LoadCollection], results: [] 2024/05/31 15:30:52 milvus_client.go:14: (ApiRequest): func [QueryIterator], args: [context.Background.WithDeadline(2024-05-31 15:32:50.476176608 +0800 CST m=+120.004301473 [1m57.967630746s]) 0xc0001501e0] 2024/05/31 15:30:52 milvus_client.go:21: (ApiResponse): func [QueryIterator], results: [0xc0000c1720] 2024/05/31 15:30:52 query_test.go:1155: [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99] 2024/05/31 15:30:52 query_test.go:1149: failed to create query plan: cannot parse expression: int64 < 100 AND int64 > 99, error: invalid expression: int64 < 100 AND int64 > 99: invalid parameter 2024/05/31 15:30:52 milvus_client.go:14: (ApiRequest): func [DropCollection], args: [context.Background.WithDeadline(2024-05-31 15:32:50.476176608 +0800 CST m=+120.004301473 [1m57.939105769s]) BizI] 2024/05/31 15:30:52 milvus_client.go:21: (ApiResponse): func [DropCollection], results: [] 2024/05/31 15:30:52 milvus_client.go:14: (ApiRequest): func [Close], args: [] 2024/05/31 15:30:52 milvus_client.go:21: (ApiResponse): func [Close], results: []
No response
fixed
Is there an existing issue for this?
Current Behavior
case:
Expected Behavior
No response
Steps To Reproduce
No response
Environment
No response
Anything else?
No response