mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
Fix data codec
Signed-off-by: neza2017 <yefu.chen@zilliz.com>
This commit is contained in:
parent
585d3f9831
commit
07d68de2a3
@ -3,6 +3,7 @@ package storage
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/zilliztech/milvus-distributed/internal/errors"
|
||||
"github.com/zilliztech/milvus-distributed/internal/proto/etcdpb"
|
||||
"github.com/zilliztech/milvus-distributed/internal/proto/schemapb"
|
||||
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
|
||||
@ -141,6 +142,8 @@ func (insertCodec *InsertCodec) Serialize(partitionID UniqueID, segmentID Unique
|
||||
err = eventWriter.AddBinaryVectorToPayload(singleData.(BinaryVectorFieldData).data, singleData.(BinaryVectorFieldData).dim)
|
||||
case schemapb.DataType_VECTOR_FLOAT:
|
||||
err = eventWriter.AddFloatVectorToPayload(singleData.(FloatVectorFieldData).data, singleData.(FloatVectorFieldData).dim)
|
||||
default:
|
||||
return nil, errors.Errorf("undefined data type %d", field.DataType)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -330,6 +333,8 @@ func (insertCodec *InsertCodec) Deserialize(blobs []*Blob) (partitionID UniqueID
|
||||
floatVectorFieldData.NumRows = len(floatVectorFieldData.data) / 8
|
||||
resultData.Data[fieldID] = floatVectorFieldData
|
||||
insertCodec.readerCloseFunc = append(insertCodec.readerCloseFunc, readerClose(binlogReader))
|
||||
default:
|
||||
return -1, -1, nil, errors.Errorf("undefined data type %d", dataType)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user