mirror of https://github.com/milvus-io/milvus.git
fix: duplicate dynamic field data by mistake (#30042)
issue : #30000 Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/30073/head
parent
80465a01b5
commit
31740445fa
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue