hanahmily commented on code in PR #459:
URL:
https://github.com/apache/skywalking-banyandb/pull/459#discussion_r1640401791
##########
banyand/stream/query.go:
##########
@@ -382,31 +403,39 @@ func (s *stream) Query(ctx context.Context, sqo
pbv1.StreamQueryOptions) (pbv1.S
tabWrappers[i].DecRef()
}
}()
+
series := make([]*pbv1.Series, len(sqo.Entities))
for i := range sqo.Entities {
series[i] = &pbv1.Series{
Subject: sqo.Name,
EntityValues: sqo.Entities[i],
}
}
- sl, err := tsdb.Lookup(ctx, series)
+ seriesList, err := tsdb.Lookup(ctx, series)
if err != nil {
return nil, err
}
+ if len(seriesList) == 0 {
+ return sqr, nil
+ }
- if len(sl) < 1 {
- return &result, nil
+ filteredRefMap, err := indexSearch(ctx, sqo, tabWrappers, seriesList)
+ if err != nil {
+ return nil, err
}
- var sids []common.SeriesID
- for i := range sl {
- sids = append(sids, sl[i].ID)
+ elementRefList, sortedRefMap, err := indexSort(s, sqo, tabWrappers,
seriesList, filteredRefMap)
+ if err != nil {
+ return nil, err
}
- var parts []*part
+
qo := queryOptions{
StreamQueryOptions: sqo,
minTimestamp: sqo.TimeRange.Start.UnixNano(),
maxTimestamp: sqo.TimeRange.End.UnixNano(),
+ filteredRefMap: filteredRefMap,
+ sortedRefMap: sortedRefMap,
Review Comment:
Could you use a single map here?
--
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]