diff --git a/internal/storage/data_codec.go b/internal/storage/data_codec.go index 5262858f93803..10f29178722b5 100644 --- a/internal/storage/data_codec.go +++ b/internal/storage/data_codec.go @@ -253,25 +253,10 @@ func (insertCodec *InsertCodec) Serialize(partitionID UniqueID, segmentID Unique var dim int64 if typeutil.IsVectorType(field.DataType) { switch field.DataType { - case schemapb.DataType_FloatVector: - dim, err = typeutil.GetDim(field) - if err != nil { - return nil, err - } - eventWriter, err = writer.NextInsertEventWriter(int(dim)) - case schemapb.DataType_BinaryVector: - dim, err = typeutil.GetDim(field) - if err != nil { - return nil, err - } - eventWriter, err = writer.NextInsertEventWriter(int(dim)) - case schemapb.DataType_Float16Vector: - dim, err = typeutil.GetDim(field) - if err != nil { - return nil, err - } - eventWriter, err = writer.NextInsertEventWriter(int(dim)) - case schemapb.DataType_BFloat16Vector: + case schemapb.DataType_FloatVector, + schemapb.DataType_BinaryVector, + schemapb.DataType_Float16Vector, + schemapb.DataType_BFloat16Vector: dim, err = typeutil.GetDim(field) if err != nil { return nil, err @@ -405,7 +390,7 @@ func AddFieldDataToPayload(eventWriter *insertEventWriter, dataType schemapb.Dat default: return fmt.Errorf("undefined data type %d", dataType) } - return fmt.Errorf("undefined data type %d", dataType) + return nil } func (insertCodec *InsertCodec) DeserializeAll(blobs []*Blob) (