Skip to content

Commit d43b030

Browse files
authored
fix: [2.5] Fix bug for gis function to filter geometry (#44968)
issue: #44961 master pr: #44966 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 <[email protected]>
1 parent a0201ef commit d43b030

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

internal/core/src/exec/expression/GISFunctionFilterExpr.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ class PhyGISFunctionFilterExpr : public SegmentExpr {
5454
return expr_->column_;
5555
}
5656

57+
std::string
58+
ToString() const {
59+
return fmt::format("{}", expr_->ToString());
60+
}
61+
62+
void
63+
MoveCursor() {
64+
if (segment_->type() == SegmentType::Sealed) {
65+
SegmentExpr::MoveCursor();
66+
}
67+
}
68+
69+
5770
private:
5871
VectorPtr
5972
EvalForIndexSegment();

internal/core/src/segcore/FieldIndexing.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -576,16 +576,14 @@ ScalarFieldIndexing<T>::process_geometry_data(int64_t reserved_offset,
576576
// Use the accessor to get geometry data and validity
577577
auto [wkb_data, is_valid] = accessor(i);
578578

579-
if (is_valid) {
580-
try {
581-
rtree_index->AddGeometry(wkb_data, global_offset);
582-
added_count++;
583-
} catch (std::exception& error) {
584-
PanicInfo(UnexpectedError,
585-
"Failed to add geometry at offset {}: {}",
586-
global_offset,
587-
error.what());
588-
}
579+
try {
580+
rtree_index->AddGeometry(wkb_data, global_offset);
581+
added_count++;
582+
} catch (std::exception& error) {
583+
PanicInfo(UnexpectedError,
584+
"Failed to add geometry at offset {}: {}",
585+
global_offset,
586+
error.what());
589587
}
590588
}
591589

0 commit comments

Comments
 (0)