github-actions[bot] commented on code in PR #70678:
URL: https://github.com/apache/doris/pull/70678#discussion_r4608895955
##########
be/test/storage/index/inverted/query/engine/boolean_truth_contract_test.cpp:
##########
@@ -559,5 +560,32 @@ TEST(BooleanTruthContractTest,
OptionalShouldBesideARequiredClauseIsTwoValued) {
}
}
+// An unscored collection given candidates keeps exactly the matches among
them, for a weight
+// that lists its rows and for one that only has a scorer.
+TEST(BooleanTruthContractTest, CollectionWithinCandidatesKeepsTheirMatches) {
+ constexpr uint32_t row_count = 1000;
+ TruthRows rows;
+ for (uint32_t doc = 0; doc < row_count; doc += 3) {
+ rows.true_rows->add(doc);
+ }
+ roaring::Roaring candidates;
+ for (uint32_t doc = 0; doc < row_count; doc += 7) {
+ candidates.add(doc);
+ }
+ OperatorBooleanQueryBuilder builder(OperatorType::OP_AND);
+ builder.add(std::make_shared<BitSetQuery>(rows.true_rows));
+ builder.add(std::make_shared<BitSetQuery>(rows.true_rows));
+ const std::array<QueryPtr, 2> queries = {builder.build(),
Review Comment:
[P2] Exercise a weight that actually lists rows
Both queries here inherit Weight::lists_rows() == false:
builder.build()->weight(false) creates OperatorBooleanWeight, and
ForwardOnlyWeight has no override either. Consequently neither case enters the
changed listed_rows(..., candidates) branch; passing nullptr there again would
leave this test green. The added regression DSLs also all have Boolean roots.
Please add a listing weight/query that asserts it receives and honors the
candidates. Also use a sparse candidate set for the forward-only case: the
current 143 candidates and 334 matches select collect_truth_set's dense
fallback (143 * 4 >= 334), leaving candidate seeking untested.
--
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]