Repository navigation
branch-4.2: [feat](inverted-index) Support configurable ngram size difference #67917 - #68774
Merged
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
Contributor
FE Regression Coverage ReportIncrement line coverage |
csun5285
added a commit
to csun5285/doris
that referenced
this pull request
Oct 12, 2026
### What problem does this PR solve? Backport to branch-4.2 of how master dropped enable_common_expr_pushdown and enable_common_expr_pushdown_for_inverted_index (apache#62222, apache#64285, apache#64479). - BE: RuntimeState::enable_common_expr_pushdown() and enable_common_expr_pushdown_for_inverted_index() are gone. Tables not merged on read always push slot-based conjuncts into SegmentIterator, the OlapScanner check that every such conjunct was pushed runs whenever segment LIMIT can be pushed, and SegmentIterator no longer returns early from _check_all_conditions_passed_inverted_index_for_column. - BE: validate_residual_scan_conjuncts from apache#62222 comes back. A residual SEARCH, a residual MATCH with enable_match_without_inverted_index off, and COUNT_ON_INDEX with residual scan conjuncts now fail with INVALID_ARGUMENT. The SEARCH and MATCH messages also say that tables merged on read do not push expressions on this branch. - FE: the two session variables are removed (apache#64285). VariableMgr takes REMOVED_SESSION_VAR_NAMES from apache#63744, listing only these two names, so SET, SET GLOBAL, SET_VAR and SELECT @@ on them still succeed and do nothing. - FE: fuzzy mode now randomizes enable_segment_limit_pushdown (apache#64479). - thrift: field 65 is marked deprecated. No field id changes. - Regression cases follow apache#64479: a setting of either removed variable becomes enable_segment_limit_pushdown with the same value; two settings in one SET_VAR or on two adjacent SET lines become one, taking the enable_common_expr_pushdown value when they differ. 214 files take apache#64479's hunks without its trailing-whitespace cleanup, 57 files that apache#64479 misses or that differ here are rewritten by the same rules (one file gets both), and 12 files keep the removed names exactly as master has them today. Upgrade BE before FE. An old BE behind a new FE no longer receives enable_common_expr_pushdown, reads it as false, and keeps conjuncts in the scanner until it is upgraded. Verified on this branch (ASAN BE): - FE and BE build, 0 checkstyle violations, BE changes clean under clang-format 16. - FE UT SessionVariablesTest, VariableMgrTest and SessionVariableBackendSelectionTest (42 cases) pass. The 23 related BE UT suites (183 cases, including the SegmentIterator apply-index-expr, short-circuit, expr-zonemap, candidate-pushdown and no-need-read-data suites) pass. - SET, SET GLOBAL, SET_VAR and SELECT @@ on both removed names succeed; SELECT @@ returns an empty string, SHOW VARIABLES lists neither, and an unknown name still fails. - With enable_segment_limit_pushdown set globally to false and then true: query_p0/limit (18 suites), test_search_slash_in_term, test_variant_predefine_index_type, infer_predicate, and 69 more suites (the ones that failed on residual predicates in this PR's earlier CI, the ones that turned the old switch off, the ones that still set the removed names, and migrated SNII and gram cases) pass, except test_search_score_topn_predicates. That suite fails the same way in both runs, and CI mutes it on other branch-4.2 PRs (apache#68213, apache#68774): the FE reports the score() usage error before the LIMIT overflow error the case expects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
csun5285
added a commit
to csun5285/doris
that referenced
this pull request
Oct 13, 2026
### What problem does this PR solve? Backport to branch-4.2 of how master dropped enable_common_expr_pushdown and enable_common_expr_pushdown_for_inverted_index (apache#62222, apache#64285, apache#64479). - BE: RuntimeState::enable_common_expr_pushdown() and enable_common_expr_pushdown_for_inverted_index() are gone. Tables not merged on read always push slot-based conjuncts into SegmentIterator, the OlapScanner check that every such conjunct was pushed runs whenever segment LIMIT can be pushed, and SegmentIterator no longer returns early from _check_all_conditions_passed_inverted_index_for_column. - BE: validate_residual_scan_conjuncts from apache#62222 comes back. A residual SEARCH, a residual MATCH with enable_match_without_inverted_index off, and COUNT_ON_INDEX with residual scan conjuncts now fail with INVALID_ARGUMENT. The SEARCH and MATCH messages also say that tables merged on read do not push expressions on this branch. - FE: the two session variables are removed (apache#64285). VariableMgr takes REMOVED_SESSION_VAR_NAMES from apache#63744, listing only these two names, so SET, SET GLOBAL, SET_VAR and SELECT @@ on them still succeed and do nothing. - FE: fuzzy mode now randomizes enable_segment_limit_pushdown (apache#64479). - thrift: field 65 is marked deprecated. No field id changes. - Regression cases follow apache#64479: a setting of either removed variable becomes enable_segment_limit_pushdown with the same value; two settings in one SET_VAR or on two adjacent SET lines become one, taking the enable_common_expr_pushdown value when they differ. 214 files take apache#64479's hunks without its trailing-whitespace cleanup, 57 files that apache#64479 misses or that differ here are rewritten by the same rules (one file gets both), and 12 files keep the removed names exactly as master has them today. Upgrade BE before FE. An old BE behind a new FE no longer receives enable_common_expr_pushdown, reads it as false, and keeps conjuncts in the scanner until it is upgraded. Verified on this branch (ASAN BE): - FE and BE build, 0 checkstyle violations, BE changes clean under clang-format 16. - FE UT SessionVariablesTest, VariableMgrTest and SessionVariableBackendSelectionTest (42 cases) pass. The 23 related BE UT suites (183 cases, including the SegmentIterator apply-index-expr, short-circuit, expr-zonemap, candidate-pushdown and no-need-read-data suites) pass. - SET, SET GLOBAL, SET_VAR and SELECT @@ on both removed names succeed; SELECT @@ returns an empty string, SHOW VARIABLES lists neither, and an unknown name still fails. - With enable_segment_limit_pushdown set globally to false and then true: query_p0/limit (18 suites), test_search_slash_in_term, test_variant_predefine_index_type, infer_predicate, and 69 more suites (the ones that failed on residual predicates in this PR's earlier CI, the ones that turned the old switch off, the ones that still set the removed names, and migrated SNII and gram cases) pass, except test_search_score_topn_predicates. That suite fails the same way in both runs, and CI mutes it on other branch-4.2 PRs (apache#68213, apache#68774): the FE reports the score() usage error before the LIMIT overflow error the case expects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
skip buildall |
yiguolei
approved these changes
Oct 15, 2026
…fference apache#67917 Cherry-picked from apache#67917 (cherry picked from commit 6a79f95) Conflicts: - NGramTokenizerValidator.java: branch-4.2 has the gram `mode` tokenizer. max_ngram_diff and the size limits apply to the legacy path only, and max_ngram_diff combined with `mode` is rejected. - IndexPolicyMgr.java: the compatibility marker max_ngram_diff=1 is added only for new legacy ngram policies (not `mode` policies). - IndexPolicy.java: isInvalid() uses NGramTokenizerValidator.isValidPolicy. - AnalyzerIdentityBuilder.java: already contains the same logic on branch-4.2. - AnalyzerIdentityBuilderTest.java, PolicyValidatorTests.java, ngram_tokenizer_test.cpp, ngram_tokenizer.h: keep the branch-4.2 tests and add the tests from the source change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
airborne12
force-pushed
the
pick-67917-branch-4.2
branch
from
October 15, 2026 11:58
32da9bb to
561f1a5
Compare
Member
Author
|
run buildall |
Contributor
FE Regression Coverage ReportIncrement line coverage |
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
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: close #67916
Related PR: #67917
Problem Summary:
Cherry-pick of #67917 (commit 6a79f95, a squash merge) to branch-4.2. Custom ngram tokenizers can now set
max_ngram_diff(0 to 255, default 1) instead of the hard-coded difference of 1. FE and BE validate the same range, and newly created policies cap absolute gram sizes at 1024. A persistedmax_ngram_diffmarker keeps marker-less policies from before the change valid.max_ngram_diffdoes not change the analyzer identity.branch-4.2 also has the gram
modetokenizer, which the source change does not know about. Adaptations:max_ngram_diffand the size limits apply to the legacy (nomode) path only.max_ngram_difftogether withmodeis rejected.Release note
Allow custom ngram tokenizers to configure the maximum difference between max_gram and min_gram with max_ngram_diff values from 0 through 255.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Validation
run-fe-ut.sh --run PolicyValidatorTests,AnalyzerIdentityBuilderTest: 117 tests, 0 failures; Checkstyle passed.NGramTokenizerTest.*: 21/21 passed (includes the 7 new tests), ASAN.origin/branch-4.2currently declares thrift field id 229 twice inPaloInternalService.thrift(enable_paimon_rust_reader,enable_prune_nested_column), so a clean branch-4.2 build fails; I bumped one id locally only to run the tests. For the BE UT I also stubbed the unrelated paimon_rust sources locally and linked with--unresolved-symbols=ignore-all. None of this is in the commit.Hunk audit (against #67917)
@@ NGramTokenizer::initbuffer sizecompile_check_end.h)initializelimits and diff check, newlineMAX_NGRAM_DIFF/MAX_NGRAM_SIZEconstantsRejectsMalformedUtf8AndCanBeResetkeptALLOWED_PROPS, constants,isValidPolicy, size/diff checksmodeprops kept,max_ngram_diffrejected withmode@@ isInvalidisValidPolicy; same behavior as 4.2's try/catch)@@ validateReferencedComponentsUsableLockedisInvalidcheck present)@@ createIndexPolicymarkermodengram@@ validateReferencedPolicyisInvalid check@@ warnIfUnsupportedmessagePROP_MAX_NGRAM_DIFF,isInvalididentity,remove(max_ngram_diff)git greponorigin/branch-4.2)testNgramDefaultBoundsDoNotChangeAnalyzerIdentitykeptmax_ngram_diff+mode🤖 Generated with Claude Code