提交 7ed63c79 编写于 作者: Z zhenshan.cao 提交者: yefu.chen

Remove system field of describle_collection in proxy

Signed-off-by: Nzhenshan.cao <zhenshan.cao@zilliz.com>
上级 7a28cfb9
...@@ -215,6 +215,21 @@ func (t *describeCollectionTask) Ts() (Timestamp, error) { ...@@ -215,6 +215,21 @@ func (t *describeCollectionTask) Ts() (Timestamp, error) {
return t.req.Timestamp, nil return t.req.Timestamp, nil
} }
func (t *describeCollectionTask) filterSchema() error {
// remove system field
var newFields []*schemapb.FieldSchema
for _, fieldMeta := range t.description.Schema.Fields {
fieldID := fieldMeta.FieldID
// todo not hardcode
if fieldID < 100 {
continue
}
newFields = append(newFields, fieldMeta)
}
t.description.Schema.Fields = newFields
return nil
}
func (t *describeCollectionTask) Execute() error { func (t *describeCollectionTask) Execute() error {
if t.req == nil { if t.req == nil {
return errors.New("null request") return errors.New("null request")
...@@ -225,10 +240,9 @@ func (t *describeCollectionTask) Execute() error { ...@@ -225,10 +240,9 @@ func (t *describeCollectionTask) Execute() error {
if err != nil { if err != nil {
return err return err
} }
cloneSchema := proto.Clone(collection.Schema)
t.description.Schema = collection.Schema t.description.Schema = cloneSchema.(*schemapb.CollectionSchema)
return t.filterSchema()
return nil
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册