From 5954f9fc91e85cf04204d88e9da3a49034db83e8 Mon Sep 17 00:00:00 2001 From: "zhenshan.cao" Date: Tue, 16 Jan 2024 21:07:36 +0800 Subject: [PATCH] fix: duplicate dynamic field data by mistake Signed-off-by: zhenshan.cao --- internal/distributed/proxy/httpserver/utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/distributed/proxy/httpserver/utils.go b/internal/distributed/proxy/httpserver/utils.go index 3e379c5e3ca74..8c89f525c93d4 100644 --- a/internal/distributed/proxy/httpserver/utils.go +++ b/internal/distributed/proxy/httpserver/utils.go @@ -406,7 +406,7 @@ func anyToColumns(rows []map[string]interface{}, sch *schemapb.CollectionSchema) fieldData := make(map[string]*schemapb.FieldData) for _, field := range sch.Fields { // skip auto id pk field - if field.IsPrimaryKey && field.AutoID { + if (field.IsPrimaryKey && field.AutoID) || field.IsDynamic { continue } var data interface{} @@ -461,15 +461,13 @@ func anyToColumns(rows []map[string]interface{}, sch *schemapb.CollectionSchema) if err != nil { return nil, err } - for idx, field := range sch.Fields { // skip auto id pk field - if field.IsPrimaryKey && field.AutoID { + if (field.IsPrimaryKey && field.AutoID) || field.IsDynamic { // remove pk field from candidates set, avoid adding it into dynamic column delete(set, field.Name) continue } - candi, ok := set[field.Name] if !ok { return nil, fmt.Errorf("row %d does not has field %s", idx, field.Name)