HappenLee commented on code in PR #54276:
URL: https://github.com/apache/doris/pull/54276#discussion_r2287224399
##########
be/src/vec/exprs/virtual_slot_ref.cpp:
##########
@@ -218,4 +218,34 @@ bool VirtualSlotRef::equals(const VExpr& other) {
return true;
}
+/**
+ * @brief Implements ANN range search evaluation for virtual slot references.
+ *
+ * This method handles the case where a virtual slot reference wraps a distance
+ * function call that can be optimized using ANN index range search. Instead of
+ * computing distances for all rows, it delegates to the underlying virtual
+ * expression to perform the optimized search.
+ *
+ * @param range_search_runtime Runtime parameters for the range search
+ * @param cid_to_index_iterators Index iterators for each column
+ * @param idx_to_cid Column ID mapping
+ * @param column_iterators Data column iterators
+ * @param row_bitmap Result bitmap to be updated with matching rows
+ * @param ann_index_stats Performance statistics collector
+ * @return Status::OK() if successful, error status otherwise
+ */
+Status VirtualSlotRef::evaluate_ann_range_search(
+ const segment_v2::AnnRangeSearchRuntime& range_search_runtime,
+ const std::vector<std::unique_ptr<segment_v2::IndexIterator>>&
cid_to_index_iterators,
+ const std::vector<ColumnId>& idx_to_cid,
+ const std::vector<std::unique_ptr<segment_v2::ColumnIterator>>&
column_iterators,
+ roaring::Roaring& row_bitmap, segment_v2::AnnIndexStats&
ann_index_stats) {
+ if (_virtual_column_expr != nullptr) {
Review Comment:
which case the `_virtual_column_expr` is nullptr? maybe should return error?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]