github-actions[bot] commented on code in PR #69700:
URL: https://github.com/apache/doris/pull/69700#discussion_r4390704544
##########
be/src/olap/rowset/segment_v2/inverted_index/util/union_term_iterator.h:
##########
@@ -142,10 +142,9 @@ class UnionTermIterator {
int32_t doc_freq() const { return _cost; }
- int32_t norm() const {
- throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
- "UnionTermIterator does not support scoring");
- }
+ // The norm belongs to the document, so the sub-iterator positioned on it
reports the same one
+ // as any other.
+ int32_t norm() const { return _docs_queue->top()->norm(); }
Review Comment:
[P2] Update the existing test that expects norm() to throw
`PhraseFreqTest.UnionTermIterator_NormThrowsException` in
`be/test/olap/rowset/segment_v2/inverted_index/query/phrase_query/phrase_freq_test.cpp:240-249`
still executes `EXPECT_THROW(union_iter.norm(), Exception)`. Its nonempty
`MockIterator` inputs return `1` from `norm()`, so this implementation makes
that assertion fail. The file is included in `doris_be_test` by the recursive
glob in `be/test/CMakeLists.txt` and is not excluded. Please update the
existing test to assert successful norm retrieval alongside the new coverage.
--
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]