From 59b0a61cb2db2c9dced008df681c16f943304fa9 Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Thu, 25 May 2023 11:39:26 +0800 Subject: [PATCH] Fill outputFields for query/search result (#24352) Signed-off-by: cai.zhang --- internal/proxy/impl.go | 7 +------ internal/proxy/task_query.go | 1 + internal/proxy/task_search.go | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/proxy/impl.go b/internal/proxy/impl.go index b6b0766262..3c3fe71bfd 100644 --- a/internal/proxy/impl.go +++ b/internal/proxy/impl.go @@ -2782,15 +2782,10 @@ func (node *Proxy) Query(ctx context.Context, request *milvuspb.QueryRequest) (* metrics.QueryLabel).Observe(float64(tr.ElapseSpan().Milliseconds())) metrics.ProxyCollectionSQLatency.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), metrics.QueryLabel, request.CollectionName).Observe(float64(tr.ElapseSpan().Milliseconds())) - - ret := &milvuspb.QueryResults{ - Status: qt.result.Status, - FieldsData: qt.result.FieldsData, - } sentSize := proto.Size(qt.result) rateCol.Add(metricsinfo.ReadResultThroughput, float64(sentSize)) metrics.ProxyReadReqSendBytes.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10)).Add(float64(sentSize)) - return ret, nil + return qt.result, nil } // CreateAlias create alias for collection, then you can search the collection with alias. diff --git a/internal/proxy/task_query.go b/internal/proxy/task_query.go index fef9936163..5769b6ff87 100644 --- a/internal/proxy/task_query.go +++ b/internal/proxy/task_query.go @@ -452,6 +452,7 @@ func (t *queryTask) PostExecute(ctx context.Context) error { if err != nil { return err } + t.result.OutputFields = t.userOutputFields metrics.ProxyReduceResultLatency.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), metrics.QueryLabel).Observe(float64(tr.RecordSpan().Milliseconds())) log.Debug("Query PostExecute done") diff --git a/internal/proxy/task_search.go b/internal/proxy/task_search.go index f65fa6c856..2f9db73287 100644 --- a/internal/proxy/task_search.go +++ b/internal/proxy/task_search.go @@ -453,6 +453,7 @@ func (t *searchTask) PostExecute(ctx context.Context) error { return err } } + t.result.Results.OutputFields = t.userOutputFields log.Ctx(ctx).Debug("Search post execute done", zap.Int64("collection", t.GetCollectionID()),