mirror of https://github.com/milvus-io/milvus.git
parent
140c5c8bcd
commit
88c9067873
|
@ -1382,7 +1382,9 @@ func (node *Proxy) Delete(ctx context.Context, request *milvuspb.DeleteRequest)
|
||||||
Condition: NewTaskCondition(ctx),
|
Condition: NewTaskCondition(ctx),
|
||||||
req: deleteReq,
|
req: deleteReq,
|
||||||
BaseDeleteTask: BaseDeleteTask{
|
BaseDeleteTask: BaseDeleteTask{
|
||||||
BaseMsg: msgstream.BaseMsg{},
|
BaseMsg: msgstream.BaseMsg{
|
||||||
|
HashValues: request.HashKeys,
|
||||||
|
},
|
||||||
DeleteRequest: internalpb.DeleteRequest{
|
DeleteRequest: internalpb.DeleteRequest{
|
||||||
Base: &commonpb.MsgBase{
|
Base: &commonpb.MsgBase{
|
||||||
MsgType: commonpb.MsgType_Delete,
|
MsgType: commonpb.MsgType_Delete,
|
||||||
|
|
|
@ -683,17 +683,9 @@ func (it *insertTask) checkFieldAutoIDAndHashPK() error {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
it.HashValues = make([]uint32, 0, len(it.BaseInsertTask.RowIDs))
|
it.HashPK(it.BaseInsertTask.RowIDs)
|
||||||
for _, rowID := range it.BaseInsertTask.RowIDs {
|
|
||||||
hash, _ := typeutil.Hash32Int64(rowID)
|
|
||||||
it.HashValues = append(it.HashValues, hash)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
it.HashValues = make([]uint32, 0, len(primaryData))
|
it.HashPK(it.BaseInsertTask.RowIDs)
|
||||||
for _, pk := range primaryData {
|
|
||||||
hash, _ := typeutil.Hash32Int64(pk)
|
|
||||||
it.HashValues = append(it.HashValues, hash)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sliceIndex := make([]uint32, rowNums)
|
sliceIndex := make([]uint32, rowNums)
|
||||||
|
@ -705,6 +697,17 @@ func (it *insertTask) checkFieldAutoIDAndHashPK() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (it *insertTask) HashPK(pks []int64) {
|
||||||
|
if len(it.HashValues) != 0 {
|
||||||
|
log.Warn("the hashvalues passed through client is not supported now, and will be overwritten")
|
||||||
|
}
|
||||||
|
it.HashValues = make([]uint32, 0, len(pks))
|
||||||
|
for _, pk := range pks {
|
||||||
|
hash, _ := typeutil.Hash32Int64(pk)
|
||||||
|
it.HashValues = append(it.HashValues, hash)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (it *insertTask) PreExecute(ctx context.Context) error {
|
func (it *insertTask) PreExecute(ctx context.Context) error {
|
||||||
sp, ctx := trace.StartSpanFromContextWithOperationName(it.ctx, "Proxy-Insert-PreExecute")
|
sp, ctx := trace.StartSpanFromContextWithOperationName(it.ctx, "Proxy-Insert-PreExecute")
|
||||||
defer sp.Finish()
|
defer sp.Finish()
|
||||||
|
@ -4694,6 +4697,9 @@ func (dt *deleteTask) PostExecute(ctx context.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dt *deleteTask) HashPK(pks []int64) {
|
func (dt *deleteTask) HashPK(pks []int64) {
|
||||||
|
if len(dt.HashValues) != 0 {
|
||||||
|
log.Warn("the hashvalues passed through client is not supported now, and will be overwritten")
|
||||||
|
}
|
||||||
dt.HashValues = make([]uint32, 0, len(pks))
|
dt.HashValues = make([]uint32, 0, len(pks))
|
||||||
for _, pk := range pks {
|
for _, pk := range pks {
|
||||||
hash, _ := typeutil.Hash32Int64(pk)
|
hash, _ := typeutil.Hash32Int64(pk)
|
||||||
|
|
Loading…
Reference in New Issue