Make field in metastore contains default value (#24228)

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
This commit is contained in:
smellthemoon 2023-05-19 12:19:23 +08:00 committed by GitHub
parent 98d86e2391
commit 473c65cd04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@ type Field struct {
AutoID bool
State schemapb.FieldState
IsDynamic bool
DefaultValue *schemapb.ValueField
}
func (f Field) Available() bool {
@ -36,6 +37,7 @@ func (f Field) Clone() *Field {
AutoID: f.AutoID,
State: f.State,
IsDynamic: f.IsDynamic,
DefaultValue: f.DefaultValue,
}
}
@ -61,7 +63,8 @@ func (f Field) Equal(other Field) bool {
checkParamsEqual(f.TypeParams, f.TypeParams) &&
checkParamsEqual(f.IndexParams, other.IndexParams) &&
f.AutoID == other.AutoID &&
f.IsDynamic == other.IsDynamic
f.IsDynamic == other.IsDynamic &&
f.DefaultValue == other.DefaultValue
}
func CheckFieldsEqual(fieldsA, fieldsB []*Field) bool {
@ -92,6 +95,7 @@ func MarshalFieldModel(field *Field) *schemapb.FieldSchema {
IndexParams: field.IndexParams,
AutoID: field.AutoID,
IsDynamic: field.IsDynamic,
DefaultValue: field.DefaultValue,
}
}