This is an automated email from the ASF dual-hosted git repository.
jianliangqi pushed a commit to branch clucene
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/clucene by this push:
new 26206be1 [Fix](bkd) fix estimate_point_count for empty tree (#145)
26206be1 is described below
commit 26206be1608775a58071d77f2d47ad363afd8028
Author: airborne12 <[email protected]>
AuthorDate: Wed Dec 6 17:14:03 2023 +0800
[Fix](bkd) fix estimate_point_count for empty tree (#145)
---
src/core/CLucene/util/bkd/bkd_reader.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/core/CLucene/util/bkd/bkd_reader.cpp
b/src/core/CLucene/util/bkd/bkd_reader.cpp
index 4f22f348..30af9515 100644
--- a/src/core/CLucene/util/bkd/bkd_reader.cpp
+++ b/src/core/CLucene/util/bkd/bkd_reader.cpp
@@ -177,9 +177,7 @@ std::shared_ptr<bkd_reader::intersect_state>
bkd_reader::get_intersect_state(bkd
index);
}
-void bkd_reader::intersect(bkd_reader::intersect_visitor *visitor)
-
-{
+void bkd_reader::intersect(bkd_reader::intersect_visitor *visitor) {
if (indexFP == 0) {
return;
}
@@ -190,6 +188,10 @@ void bkd_reader::intersect(bkd_reader::intersect_visitor
*visitor)
}
int64_t bkd_reader::estimate_point_count(bkd_reader::intersect_visitor
*visitor) {
+ // indexFP is 0 means it's a empty tree, just return 0
+ if (indexFP == 0) {
+ return 0;
+ }
// because we will modify min/max packed value in intersect, so we copy
them in the first time.
auto min_packed_value = min_packed_value_;
auto max_packed_value = max_packed_value_;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]