Skip to content
Snippets Groups Projects
Unverified Commit 45e7d26b authored by Kun Yu 【余昆】's avatar Kun Yu 【余昆】 Committed by GitHub
Browse files

Fix retrieve when output_fields is nil (#5623)


Signed-off-by: default avatarfishpenguin <kun.yu@zilliz.com>
parent a2ac3e04
No related branches found
No related tags found
No related merge requests found
......@@ -1481,8 +1481,22 @@ func (rt *RetrieveTask) PreExecute(ctx context.Context) error {
zap.Any("requestID", rt.Base.MsgID), zap.Any("requestType", "retrieve"))
rt.Base.MsgType = commonpb.MsgType_Retrieve
if rt.retrieve.Ids == nil {
errMsg := "Retrieve ids is nil"
return errors.New(errMsg)
}
rt.Ids = rt.retrieve.Ids
rt.OutputFields = rt.retrieve.OutputFields
if len(rt.retrieve.OutputFields) == 0 {
schema, err := globalMetaCache.GetCollectionSchema(ctx, collectionName)
if err != nil {
return err
}
for _, field := range schema.Fields {
rt.OutputFields = append(rt.OutputFields, field.Name)
}
} else {
rt.OutputFields = rt.retrieve.OutputFields
}
rt.ResultChannelID = Params.RetrieveChannelNames[0]
rt.DbID = 0 // todo(yukun)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment