github-actions[bot] commented on code in PR #67180:
URL: https://github.com/apache/doris/pull/67180#discussion_r3869542660
##########
be/src/storage/index/inverted/query/phrase_query.cpp:
##########
@@ -53,6 +53,14 @@ void PhraseQuery::add(const InvertedIndexQueryInfo&
query_info) {
init_ordered_sloppy_phrase_matcher(query_info, is_similarity);
}
+ // Two-phase evaluation with a pushed-down candidate set: the candidate
+ // bitmap joins the leapfrog intersection (restricting doc-list walking and
+ // position verification to candidates) but never a matcher's postings, so
+ // phrase semantics stay with the real term iterators.
+ if (_context->candidate_rows != nullptr) {
+
_iterators.emplace_back(std::make_shared<RoaringDocIdIterator>(_context->candidate_rows));
Review Comment:
[P1] Do not expose this candidate-restricted bitmap as a full-domain
expression result. `FunctionMatchBase` still pairs it with the full-segment
null bitmap, while `VCompoundPred` stops an `AND` when the TRUE bitmap is
empty. If nullable phrase A has matches only outside the candidate set and a
candidate row has `A = NULL` followed by indexed `B = FALSE`, the shortcut
returns NULL without evaluating B, so `NOT (A AND B)` drops a row whose SQL
result is TRUE. Either make the result domain explicit and make three-valued
shortcuts candidate-aware, or avoid this restriction for compound/virtual
evaluation; please add a cold-cache nullable compound regression.
##########
be/src/storage/index/inverted/query/phrase_query.cpp:
##########
@@ -168,7 +182,8 @@ void PhraseQuery::search_by_skiplist(roaring::Roaring&
roaring) {
continue;
}
roaring.add(doc);
- int32_t norm = visit_node(*_lead1, Norm {});
+ DORIS_CHECK(_norm_source != nullptr);
Review Comment:
[P2] Move this invariant check out of the per-document scoring loop.
`_norm_source` is fixed once in `add()` after `_iterators` is complete, so a
broad scoring phrase repeats the same release-mode `DORIS_CHECK` for every
matched row; root `AGENTS.md` permits only `DCHECK` inside
performance-sensitive loops. Validate it once before entering the loop when
similarity scoring is active, then read the norm here without a release check.
--
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]