Skip to content

Commit

Permalink
fix: duplicate dynamic field data by mistake (#30043)
Browse files Browse the repository at this point in the history
issue: #30000 
pr: #30042

Signed-off-by: zhenshan.cao <[email protected]>
  • Loading branch information
czs007 authored Jan 16, 2024
1 parent 9f6a19c commit 9aceff5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/distributed/proxy/httpserver/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9aceff5

Please sign in to comment.