Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Signed-off-by: shaoting-huang <[email protected]>
  • Loading branch information
shaoting-huang committed Jun 14, 2024
1 parent b481d2a commit a99ef59
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions internal/storage/data_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) (
Expand Down

0 comments on commit a99ef59

Please sign in to comment.