mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
/kind improvement issue: https://github.com/milvus-io/milvus/discussions/25620 pr: https://github.com/milvus-io/milvus/pull/35063 --------- Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
4138a9f87d
commit
cc188fb322
@ -1033,7 +1033,7 @@ func MergeFieldData(dst []*schemapb.FieldData, src []*schemapb.FieldData) error
|
||||
|
||||
// GetVectorFieldSchema get vector field schema from collection schema.
|
||||
func GetVectorFieldSchema(schema *schemapb.CollectionSchema) (*schemapb.FieldSchema, error) {
|
||||
for _, fieldSchema := range schema.Fields {
|
||||
for _, fieldSchema := range schema.GetFields() {
|
||||
if IsVectorType(fieldSchema.DataType) {
|
||||
return fieldSchema, nil
|
||||
}
|
||||
@ -1044,7 +1044,7 @@ func GetVectorFieldSchema(schema *schemapb.CollectionSchema) (*schemapb.FieldSch
|
||||
// GetVectorFieldSchemas get vector fields schema from collection schema.
|
||||
func GetVectorFieldSchemas(schema *schemapb.CollectionSchema) []*schemapb.FieldSchema {
|
||||
ret := make([]*schemapb.FieldSchema, 0)
|
||||
for _, fieldSchema := range schema.Fields {
|
||||
for _, fieldSchema := range schema.GetFields() {
|
||||
if IsVectorType(fieldSchema.DataType) {
|
||||
ret = append(ret, fieldSchema)
|
||||
}
|
||||
@ -1055,7 +1055,7 @@ func GetVectorFieldSchemas(schema *schemapb.CollectionSchema) []*schemapb.FieldS
|
||||
|
||||
// GetPrimaryFieldSchema get primary field schema from collection schema
|
||||
func GetPrimaryFieldSchema(schema *schemapb.CollectionSchema) (*schemapb.FieldSchema, error) {
|
||||
for _, fieldSchema := range schema.Fields {
|
||||
for _, fieldSchema := range schema.GetFields() {
|
||||
if fieldSchema.IsPrimaryKey {
|
||||
return fieldSchema, nil
|
||||
}
|
||||
@ -1066,7 +1066,7 @@ func GetPrimaryFieldSchema(schema *schemapb.CollectionSchema) (*schemapb.FieldSc
|
||||
|
||||
// GetPartitionKeyFieldSchema get partition field schema from collection schema
|
||||
func GetPartitionKeyFieldSchema(schema *schemapb.CollectionSchema) (*schemapb.FieldSchema, error) {
|
||||
for _, fieldSchema := range schema.Fields {
|
||||
for _, fieldSchema := range schema.GetFields() {
|
||||
if fieldSchema.IsPartitionKey {
|
||||
return fieldSchema, nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user