mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-02 01:06:41 +08:00
fix: Fix bug for gis function to filter geometry (#44966)
issue: #44961 This PR fixes 3 geometry related bugs: 1. Implement `ToString` interface for GisFunctionFilter. 2. Ignore GisFunctionFilter `MoveCursor` for growing segment. 3. Don't skip null geometry for building R-Tree index, should be record in null_offsets. --------- Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
a35a3b7c69
commit
b23d75a032
@ -56,6 +56,18 @@ class PhyGISFunctionFilterExpr : public SegmentExpr {
|
||||
return expr_->column_;
|
||||
}
|
||||
|
||||
std::string
|
||||
ToString() const {
|
||||
return fmt::format("{}", expr_->ToString());
|
||||
}
|
||||
|
||||
void
|
||||
MoveCursor() {
|
||||
if (segment_->type() == SegmentType::Sealed) {
|
||||
SegmentExpr::MoveCursor();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
VectorPtr
|
||||
EvalForIndexSegment();
|
||||
|
||||
@ -531,16 +531,14 @@ ScalarFieldIndexing<T>::process_geometry_data(int64_t reserved_offset,
|
||||
// Use the accessor to get geometry data and validity
|
||||
auto [wkb_data, is_valid] = accessor(i);
|
||||
|
||||
if (is_valid) {
|
||||
try {
|
||||
rtree_index->AddGeometry(wkb_data, global_offset);
|
||||
added_count++;
|
||||
} catch (std::exception& error) {
|
||||
ThrowInfo(UnexpectedError,
|
||||
"Failed to add geometry at offset {}: {}",
|
||||
global_offset,
|
||||
error.what());
|
||||
}
|
||||
try {
|
||||
rtree_index->AddGeometry(wkb_data, global_offset);
|
||||
added_count++;
|
||||
} catch (std::exception& error) {
|
||||
ThrowInfo(UnexpectedError,
|
||||
"Failed to add geometry at offset {}: {}",
|
||||
global_offset,
|
||||
error.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user