You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2025/04/02 04:57:05 UTC
(skywalking-banyandb) branch stream created (now caa54228)
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a change to branch stream
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
at caa54228 Fix NPE
This branch includes the following new commits:
new caa54228 Fix NPE
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(skywalking-banyandb) 01/01: Fix NPE
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch stream
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit caa542288a62e38304c6ae0841def16e812d19d4
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Wed Apr 2 04:55:44 2025 +0000
Fix NPE
Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
banyand/stream/index.go | 6 +++++-
pkg/query/logical/stream/index_filter.go | 20 ++++++++++++--------
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/banyand/stream/index.go b/banyand/stream/index.go
index 0d776078..cb2b2ebc 100644
--- a/banyand/stream/index.go
+++ b/banyand/stream/index.go
@@ -90,11 +90,15 @@ func (e *elementIndex) Search(ctx context.Context, seriesList []uint64, filter i
continue
}
if result == nil {
- result, resultTS = pl, plTS
+ result = pl
} else {
if err := result.Union(pl); err != nil {
return nil, nil, err
}
+ }
+ if resultTS == nil {
+ resultTS = plTS
+ } else {
if err := resultTS.Union(plTS); err != nil {
return nil, nil, err
}
diff --git a/pkg/query/logical/stream/index_filter.go b/pkg/query/logical/stream/index_filter.go
index 7b875862..be3f090b 100644
--- a/pkg/query/logical/stream/index_filter.go
+++ b/pkg/query/logical/stream/index_filter.go
@@ -211,22 +211,26 @@ func execute(searcher index.GetSearcher, seriesID common.SeriesID, n *node, lp l
if err != nil {
return nil, nil, err
}
- if result == nil {
- result = r
- continue
- }
- result, err = lp.merge(result, r)
- if err != nil {
+ if result, err = merge(result, r, lp); err != nil {
return nil, nil, err
}
- resultTS, err = lp.merge(resultTS, rt)
- if err != nil {
+ if resultTS, err = merge(resultTS, rt, lp); err != nil {
return nil, nil, err
}
}
return result, resultTS, nil
}
+func merge(result posting.List, list posting.List, lp logicalOP) (posting.List, error) {
+ if result == nil {
+ return list, nil
+ }
+ if list == nil {
+ return result, nil
+ }
+ return lp.merge(result, list)
+}
+
type andNode struct {
*node
}