Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Search from master-latest milvus with empty output field name gets error parse output field name failed #602

Open
1 task done
ThreadDao opened this issue Oct 19, 2023 · 1 comment
Assignees

Comments

@ThreadDao
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

  • server milvus image: master-20231018-2815c846
  • go-sdk version: v2.2.7

Case:

// test query empty or one scalar output fields
func TestQueryEmptyOutputFields(t *testing.T) {
	t.Parallel()
	ctx := createContext(t, time.Second*common.DefaultTimeout)
	// connect
	mc := createMilvusClient(ctx, t)
	for _, enableDynamic := range []bool{true} {
		// create, insert, index
		collName, ids := createCollectionWithDataIndex(ctx, t, mc, true, enableDynamic, true)

		// Load collection
		errLoad := mc.LoadCollection(ctx, collName, false)
		common.CheckErr(t, errLoad, true)

		//query with empty output fields []string{}-> output "int64"
		queryEmptyOutputs, _ := mc.QueryByPks(
			ctx, collName, []string{common.DefaultPartition},
			entity.NewColumnInt64(common.DefaultIntFieldName, ids.(*entity.ColumnInt64).Data()[:10]),
			[]string{},
		)
		common.CheckOutputFields(t, queryEmptyOutputs, []string{common.DefaultIntFieldName})

		//query with empty output fields []string{""}-> output "int64" and dynamic field
		queryEmptyOutputs, err := mc.QueryByPks(
			ctx, collName, []string{common.DefaultPartition},
			entity.NewColumnInt64(common.DefaultIntFieldName, ids.(*entity.ColumnInt64).Data()[:10]),
			[]string{""},
		)
		if enableDynamic {
			common.CheckOutputFields(t, queryEmptyOutputs, []string{"", common.DefaultIntFieldName})
		} else {
			common.CheckErr(t, err, false, "not exist")
		}

		// query with "float" output fields -> output "int64, float"
		queryFloatOutputs, _ := mc.QueryByPks(
			ctx, collName, []string{common.DefaultPartition},
			entity.NewColumnInt64(common.DefaultIntFieldName, ids.(*entity.ColumnInt64).Data()[:10]),
			[]string{common.DefaultFloatFieldName},
		)
		common.CheckOutputFields(t, queryFloatOutputs, []string{common.DefaultIntFieldName, common.DefaultFloatFieldName})
	}
}
  1. case error log
=== CONT  TestSearchEmptyOutputFields
2023/10/18 18:04:04 milvus_client.go:13: (ApiRequest): func [NewDefaultGrpcClient], args: [context.Background.WithDeadline(2023-10-18 18:06:04.588097 +0800 CST m=+120.008526616 [1m59.999922823s]) 10.102.7.201:19530]
2023/10/18 18:04:04 milvus_client.go:20: (ApiResponse): func [NewDefaultGrpcClient], results: [0xc00015e8a0]
2023/10/18 18:04:04 milvus_client.go:13: (ApiRequest): func [CreateCollection], args: [context.Background.WithDeadline(2023-10-18 18:06:04.588097 +0800 CST m=+120.008526616 [1m59.92333458s]) qlUJrX 0xc000034be0 2 []]
2023/10/18 18:04:04 milvus_client.go:20: (ApiResponse): func [CreateCollection], results: []
2023/10/18 18:04:04 milvus_client.go:13: (ApiRequest): func [Insert], args: [context.Background.WithDeadline(2023-10-18 18:06:04.588097 +0800 CST m=+120.008526616 [1m59.864998936s]) qlUJrX _default [0xc000386b40 0xc000386b70 0xc000386090]]
2023/10/18 18:04:05 milvus_client.go:20: (ApiResponse): func [Insert], results: [0xc000403b30]
2023/10/18 18:04:05 milvus_client.go:13: (ApiRequest): func [Flush], args: [context.Background.WithDeadline(2023-10-18 18:06:04.588097 +0800 CST m=+120.008526616 [1m58.824136328s]) qlUJrX false]
2023/10/18 18:04:08 milvus_client.go:20: (ApiResponse): func [Flush], results: []
2023/10/18 18:04:08 milvus_client.go:13: (ApiRequest): func [CreateIndex], args: [context.Background.WithDeadline(2023-10-18 18:06:04.588097 +0800 CST m=+120.008526616 [1m56.189375364s]) qlUJrX floatVec false 0xc0003fe2a0 [0x1670560]]
2023/10/18 18:04:10 milvus_client.go:20: (ApiResponse): func [CreateIndex], results: []
2023/10/18 18:04:10 milvus_client.go:13: (ApiRequest): func [LoadCollection], args: [context.Background.WithDeadline(2023-10-18 18:06:04.588097 +0800 CST m=+120.008526616 [1m54.093180072s]) qlUJrX []]
2023/10/18 18:04:14 milvus_client.go:20: (ApiResponse): func [LoadCollection], results: []
2023/10/18 18:04:14 milvus_client.go:13: (ApiRequest): func [Search], args: [context.Background.WithDeadline(2023-10-18 18:06:04.588097 +0800 CST m=+120.008526616 [1m49.892318088s]) qlUJrX []  [] 5 floatVec L2 10 0xc00003daf0 []]
2023/10/18 18:04:14 milvus_client.go:18: (ApiResponse): func [Search], error: parse output field name failed: 
2023/10/18 18:04:14 search_test.go:308: parse output field name failed: 
    response_check.go:16: 
                Error Trace:        /Users/nausicca/projects/go/milvus-sdk-go/test/testcases/response_check.go:16
                                                            /Users/nausicca/projects/go/milvus-sdk-go/test/testcases/search_test.go:309
                Error:              Received unexpected error:
                                    parse output field name failed: 
                                    (1) attached stack trace
                                      -- stack trace:
                                      | github.com/milvus-io/milvus-sdk-go/v2/client.handleRespStatus
                                      |         /Users/nausicca/projects/go/milvus-sdk-go/client/collection.go:64
                                      | github.com/milvus-io/milvus-sdk-go/v2/client.(*GrpcClient).Search
                                      |         /Users/nausicca/projects/go/milvus-sdk-go/client/data.go:69
                                      | github.com/milvus-io/milvus-sdk-go/v2/test/base.(*MilvusClient).Search
                                      |         /Users/nausicca/projects/go/milvus-sdk-go/test/base/milvus_client.go:391
                                      | github.com/milvus-io/milvus-sdk-go/v2/test/testcases.TestSearchEmptyOutputFields
                                      |         /Users/nausicca/projects/go/milvus-sdk-go/test/testcases/search_test.go:295
                                      | testing.tRunner
                                      |         /usr/local/go/src/testing/testing.go:1576
                                      | runtime.goexit
                                      |         /usr/local/go/src/runtime/asm_amd64.s:1598
                                    Wraps: (2) parse output field name failed: 
                                    Error types: (1) *withstack.withStack (2) *errutil.leafError
                Test:               TestSearchEmptyOutputFields
2023/10/18 18:04:14 milvus_client.go:13: (ApiRequest): func [DropCollection], args: [context.Background.WithDeadline(2023-10-18 18:06:04.588097 +0800 CST m=+120.008526616 [1m49.840878125s]) qlUJrX]
2023/10/18 18:04:14 milvus_client.go:20: (ApiResponse): func [DropCollection], results: []
2023/10/18 18:04:14 milvus_client.go:13: (ApiRequest): func [Close], args: []

go-sdk Milvus server behavior
2.2.7 v2.2.14 If collection has dynamic data, then return [pk, ""] two fields, the value of field "" is actually the value of $meta fieldIf disable dynamic,then return error: "" field not exist
2.2.7 master-latest It looks like Go-sdk encounter erro: "parse output field name failed" when handle server return
2.3.1 master-latest Regardless of whether dynamic fields are enabled or not, the error "field not exist" is returned

Expected Behavior

I'm also not sure what the expectations should be. Maybe you can help judge it

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

@ThreadDao
Copy link
Contributor Author

/assign @yanliang567

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants