hanahmily commented on code in PR #1001:
URL:
https://github.com/apache/skywalking-banyandb/pull/1001#discussion_r3031346510
##########
banyand/dquery/topn.go:
##########
@@ -111,53 +143,26 @@ func (t *topNQueryProcessor) Rev(ctx context.Context,
message bus.Message) (resp
return
}
var allErr error
- aggregator := measure.CreateTopNPostProcessor(request.GetTopN(),
- agg, request.GetFieldValueSort())
- var tags []string
- var responseCount int
- for _, f := range ff {
- if m, getErr := f.Get(); getErr != nil {
- allErr = multierr.Append(allErr, getErr)
- } else {
- d := m.Data()
- if d == nil {
- continue
- }
- responseCount++
- topNResp := d.(*measurev1.TopNResponse)
- for _, l := range topNResp.Lists {
- for _, tn := range l.Items {
- if tags == nil {
- tags = make([]string, 0,
len(tn.Entity))
- for _, e := range tn.Entity {
- tags = append(tags,
e.Key)
- }
- }
- entityValues := make(pbv1.EntityValues,
0, len(tn.Entity))
- for _, e := range tn.Entity {
- entityValues =
append(entityValues, e.Value)
- }
- aggregator.Put(entityValues,
tn.Value.GetInt().GetValue(), uint64(tn.Timestamp.AsTime().UnixMilli()),
tn.Version)
- }
- }
- }
+ fieldType := t.getTopNFieldType(ctx, request.Groups[0],
request.GetName())
Review Comment:
It makes sense
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]