eldenmoon opened a new pull request, #71163:
URL: https://github.com/apache/doris/pull/71163

   ### Background
   
   Tokenized inverted indexes store norms for BM25 record-length scoring. 
VARIANT subpaths inherit their index properties, and their aggregate norms 
storage can be large. The BE setting `inverted_index_skip_norms_for_variant` 
currently suppresses those norms even when an index explicitly requests them; 
see the [scoring 
documentation](https://doris.apache.org/docs/dev/table-design/index/inverted-index/scoring/).
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Enhancement
   
   Problem Summary:
   
   Operators cannot skip norms across most VARIANT paths while retaining them 
for selected indexes used by `score()`. Honor an explicit `norms` property 
first, and consult the BE setting only when that property is absent. Most of 
the change updates existing tests that deliberately asserted the previous 
precedence. Clusters using the default BE setting keep their existing behavior.
   
   | Index `norms` | BE skip setting | Before | After |
   | --- | --- | --- | --- |
   | `true` | `true` | Omit norms | Write norms |
   | `false` | Either | Omit norms | Omit norms |
   | Unspecified | `true` | Omit norms | Omit norms |
   | Unspecified | `false` | Write norms | Write norms |
   
   ### Details
   
   - **Before and after:** An explicit `norms=true` on an analyzed VARIANT path 
now survives the global skip setting. Previously, new segments lacked norms and 
BM25 scoring failed. Explicit false and unspecified properties retain their 
previous behavior.
   - **Configs and defaults:** No new configuration. 
`inverted_index_skip_norms_for_variant` remains dynamic and defaults to false; 
it supplies the default only for VARIANT paths without an explicit norms 
property.
   - **Impact on existing users:** Clusters combining skip=true and explicit 
norms=true will write norms for those indexes after upgrading, increasing their 
index storage while enabling scoring on newly written segments. Existing 
segments missing norms require rebuilding or rewriting before the whole 
collection can be scored. Ordinary column indexes are unaffected.
   - **Behavior change:** Explicit index metadata takes precedence in the 
existing helper shared by CLucene writes, SNII writes and SNII destination 
policy. No storage-format fields change.
   
   ### Testing
   
   - Earlier candidate `ca0402815bc` on base `720f7f7bc89`: the three focused 
ASAN tests failed before the policy change; 38 related ASAN tests passed 
afterward.
   - On that candidate: ASAN BE/FE build passed; the V2 and SNII norms 
regression suites both passed in normal mode after script-generated goldens. 
Existing golden sections were unchanged.
   - Publication head `151738443e9` on Apache master `dc5517d7afb`: both 
patches applied without conflicts; clang-format 16, build hygiene and diff 
whitespace checks passed. Full build and runtime tests have not been rerun on 
this newer base; CI is requested separately.
   
   ### Notes for Reviewers
   
   The change intentionally reverses the old policy rather than adding a second 
override switch. The original regression and unit tests asserted that the BE 
setting defeated explicit true; those expectations are updated here. Read-side 
physical-capability checks remain in place.
   
   ### Release note
   
   Explicit inverted-index norms properties now take precedence over 
inverted_index_skip_norms_for_variant. The BE setting applies only when a 
VARIANT path has no explicit norms property. Existing segments are not 
rewritten automatically.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details)
   - Does this need documentation: Yes (companion apache/doris-website PR being 
prepared for current docs and release-version compatibility notes)
   - Pre-submission status: Partially verified: local runtime checks passed on 
the earlier candidate; publication head awaits CI on the updated master base.
   
   ### AI Disclosure
   
   - Tool: OpenAI Codex (GPT-6)
   - Generated: Implementation, tests, self-review and PR description.
   - Human review: The author directed the precedence change and publication; 
extent of manual code review has not been reported.
   


-- 
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]

Reply via email to