branch-4.1: [fix](inverted index) Add a norms index property and a BE config to skip norms on variant paths - #68140
Merged
eldenmoon merged 6 commits intoSep 19, 2026
Conversation
### What problem does this PR solve? Issue Number: None Related PR: apache#68039 Problem Summary: Analyzed inverted indexes inherited by sparse VARIANT subcolumns write dense norms. Add the variant norms switch and skip norms for those indexes by default while retaining norms for ordinary analyzed indexes and an opt-in compatibility setting. ### Release note Variant subcolumn inverted indexes no longer write BM25 norms by default. ### Check List (For Author) - Test: Source-level verification only in this commit; focused build/test follows. - Regression test / Unit Test / Manual test / No need to test (with reason) - Behavior changed: Yes (variant subcolumn norms default to omitted) - Does this need documentation: No
### What problem does this PR solve? Issue Number: None Related PR: apache#68039 Problem Summary: Make norms an inverted-index property. Variant path indexes omit norms by default, while the norms property can restore them per index; ordinary column indexes keep norms by default. ### Release note Inverted indexes accept the norms property. ### Check List (For Author) - Test: Pending focused build and test verification - Behavior changed: Yes (norms are controlled per index) - Does this need documentation: Yes
### What problem does this PR solve? Issue Number: None Related PR: apache#68039 Problem Summary: Extend the norms regression coverage to whole-column VARIANT indexes and verify that per-subcolumn copies inherit the default or explicit norms property. ### Release note None ### Check List (For Author) - Test: Regression test added; execution pending - Behavior changed: No - Does this need documentation: No
### What problem does this PR solve? Issue Number: None Related PR: apache#68039 Problem Summary: Add an opt-in BE config that omits BM25 norms for indexes on variant paths, regardless of their per-index norms property, while preserving ordinary-column behavior. ### Release note Add inverted_index_skip_norms_for_variant for reducing dense norms on variant paths. ### Check List (For Author) - Test: Focused unit and regression coverage added; execution pending - Behavior changed: Yes (opt-in BE config) - Does this need documentation: Yes
### What problem does this PR solve?\n\nIssue Number: None\n\nRelated PR: apache#68039\n\nProblem Summary: BM25 scoring used a zero average document length when a CLucene segment omitted norms, producing invalid or misleading scores. Reject scoring when an analyzed index has a segment without norms, while keeping MATCH filtering available and preserving the VARIANT skip-norms configuration behavior. This selective backport excludes all SNII changes.\n\n### Release note\n\nBM25 scoring now reports an error for analyzed indexes whose segments were written without norms.\n\n### Check List (For Author)\n\n- Test: FE build, FE unit test, format check; BE build and regression are blocked by the local ASAN/toolchain environment.\n- Behavior changed: Yes (BM25 scoring without norms is rejected)\n- Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Member
Author
|
run buildall |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
yiguolei
approved these changes
Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: None
Related PR: #68039
Problem Summary:
This is a selective backport of #68039 to
branch-4.1. It keeps the CLucene/V2/V3 VARIANT-pathnorms handling and deliberately excludes all SNII-related changes.
An inverted index on a VARIANT column is copied to every extracted subcolumn, so dense BM25 norms
can consume substantial storage when many paths are indexed. This backport adds the
normsindexproperty and the mutable BE config
inverted_index_skip_norms_for_variant(off by default). Theconfig omits norms for VARIANT-path indexes regardless of the index property.
CLucene BM25 scoring now rejects an analyzed index when any segment was written without norms,
while MATCH filtering remains available. This prevents NaN or misleading scores for mixed-generation
segments. Whole-column and subcolumn VARIANT regression coverage is included.
SNII scope:
be/src/storage/index/snii/**or SNII-specific tests/regressions are changed.Release note
Added the
normsinverted-index property and the BE configinverted_index_skip_norms_for_variantfor CLucene/V2/V3 VARIANT-path indexes. BM25
score()now fails when an analyzed segment has nonorms instead of returning invalid or inconsistent scores.
Check List (For Author)
./build.sh --fe: BUILD SUCCESS; Checkstyle reports 0 violations../run-fe-ut.sh --run org.apache.doris.analysis.InvertedIndexNormsPropertyTest: 2 passed.git diff --check: passed.enable_segment_limit_pushdownsession variable. The target regression was not executed locally because the BE build is
blocked by the available Lance-C header/library mismatch (
lance_session_manager.cppexpects session APIs absent from
thirdparty/installed/include/lance/lance.h). The ASANconfiguration is additionally blocked by LeakSanitizer under ptrace/OpenBLAS
getarch;the regression golden was reused from the upstream non-SNII result and was not regenerated
locally.
remain unchanged).