milvus-io / milvus-sdk-go

Go SDK for Milvus.
Apache License 2.0
353 stars 110 forks source link

[Bug]: When specifying a key of dynamic data to output, the keys of the entire dynamic fields is returned #820

Closed ThreadDao closed 2 months ago

ThreadDao commented 2 months ago

Is there an existing issue for this?

Current Behavior

  1. Collection dynamic_EYEwjKiR has int64 and float_vector two fields, and enable dynamic
  2. insert 2000 rows like:
    # first row: ["int64": 0, "float_vector": [xxxxx], 'x': 0.0, 'y': '0']
        for i in range(0, nb):
            row = {ct.default_int64_field_name: i,
                    "x": i * 1.0,
                    "y": str(i),
                    ct.default_float_vec_field_name: cf.gen_vectors(1, ct.default_dim, vector_data_type="FLOAT_VECTOR")[0]
                    }
            data.append(row)
  3. pymilvus query and output key 'x' of dynamic field
    c.query('int64 == 1', output_fields=["x"])
    data: ["{'int64': 1, 'x': 1.0}"] , extra_info: {'cost': 0}
  4. go-sdk query and output key 'x' of dynamic field
    res, _ := mc.Query(ctx, name, nil, "int64 == 0", []string{"x"})
    log.Println(res.GetColumn("x").FieldData())
    type:JSON field_name:"$meta" scalars:<json_data:<data:"{\"x\":0.0,\"y\":\"0\"}" > > is_dynamic:true

Expected Behavior

No response

Steps To Reproduce

[server logs](https://grafana-4am.zilliz.cc/explore?panes=%7B%22RYA%22:%7B%22datasource%22:%22vhI6Vw67k%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bcluster%3D%5C%224am%5C%22,%20namespace%3D%5C%22qa-milvus%5C%22,%20pod%3D~%5C%22level-zero-par-key-op-29-6929-milvus-.%2A%5C%22%7D%20%7C%3D%20%5C%22Query%20received%5C%22%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22vhI6Vw67k%22%7D,%22editorMode%22:%22code%22,%22hide%22:false%7D%5D,%22range%22:%7B%22from%22:%221726219541988%22,%22to%22:%221726219710029%22%7D%7D%7D&schemaVersion=1&orgId=1)
pods:

level-zero-par-key-op-29-6929-milvus-datanode-c995d759d-hlccw     1/1     Running            0                  16h     10.104.6.183    4am-node13   <none>           <none>
level-zero-par-key-op-29-6929-milvus-datanode-c995d759d-tvx5m     1/1     Running            0                  16h     10.104.33.117   4am-node36   <none>           <none>
level-zero-par-key-op-29-6929-milvus-indexnode-585f664548-9n8hg   1/1     Running            0                  16h     10.104.21.106   4am-node24   <none>           <none>
level-zero-par-key-op-29-6929-milvus-indexnode-585f664548-rcqc5   1/1     Running            0                  16h     10.104.16.126   4am-node21   <none>           <none>
level-zero-par-key-op-29-6929-milvus-mixcoord-5bb8798564-p8zcg    1/1     Running            0                  16h     10.104.21.99    4am-node24   <none>           <none>
level-zero-par-key-op-29-6929-milvus-proxy-bf9db885f-v4tvx        1/1     Running            0                  16h     10.104.33.116   4am-node36   <none>           <none>
level-zero-par-key-op-29-6929-milvus-querynode-0-59dcc9768gkxn6   1/1     Running            0                  16h     10.104.20.161   4am-node22   <none>           <none>
level-zero-par-key-op-29-6929-milvus-querynode-0-59dcc9768m7czx   1/1     Running            0                  16h     10.104.20.162   4am-node22   <none>           <none>
level-zero-par-key-op-29-6929-milvus-querynode-0-59dcc9768mv89f   1/1     Running            0                  16h     10.104.32.37    4am-node39   <none>           <none>
level-zero-par-key-op-29-6929-milvus-querynode-0-59dcc9768rgltk   1/1     Running            0                  16h     10.104.18.249   4am-node25   <none>           <none>


### Environment

_No response_

### Anything else?

_No response_
ThreadDao commented 2 months ago

/assign @congqixia

ThreadDao commented 2 months ago

2.4-20240912-13d443eb-amd64

zhagnlu commented 2 months ago

image because merge error of other pr in 2.4 branch. only 2.4 has this problem.

ThreadDao commented 2 months ago

fixed