Skip to content

branch-4.2: [fix](nereids) Do not infer MATCH and SEARCH predicates across column equalities #69419 - #69561

Merged
yiguolei merged 1 commit into
apache:branch-4.2from
airborne12:backport/69419-branch-4.2
Oct 24, 2026
Merged

yiguolei merged 1 commit into
apache:branch-4.2from
airborne12:backport/69419-branch-4.2

Conversation

@airborne12

Copy link
Copy Markdown
Member

What problem does this PR solve?

Related PR: #69419

Problem Summary: Backport #69419 to branch-4.2.

Predicate inference copied a predicate on one column to every column that is equal to it, also when the predicate contained MATCH, multi_match or SEARCH. Their result depends on the inverted index of the column, not only on its value: with c1 = c2 and different parsers on the two columns, the copy removed matching rows, and with the same index it doubled score(), so a minimum score let low-scored rows through. InferPredicateByReplace.infer now skips every input that contains Match, MultiMatch, Search or SearchExpression.

Branch adaptations

The branch does not have the NoneMovableFunction check that master has next to the new check, so only the new check is added. The test imports SearchDslParser from its package on the branch.

Release note

Fix wrong results and scores when predicate inference copied a MATCH, multi_match or SEARCH predicate to an equal column.

Check List (For Author)

  • Test
    • Regression test
    • Unit Test
    • Manual test
  • Behavior changed:
    • Yes. Predicate inference no longer copies a predicate that contains MATCH, multi_match or SEARCH to an equal column.
  • Does this need documentation?
    • No.

Validation

Validated together with the other two backports (#69399, #69419 and #69292 on branch-4.2 at ecbc5fe), in a local ASAN build:

  • PASS: FE unit tests LogicalPlanDeepCopierTest, CTEInlineTest, InferPredicateByReplaceTest, InferPredicatesTest, UnequalPredicateInferTest, BindScoreToOlapScanTest, SearchExpressionTest, TopNRuntimeFilterTest, PullUpProjectExprUnderTopNTest and MaterializedViewUtilsTest (280 tests), and FE Checkstyle.
  • PASS: ./build.sh --fe --be.
  • PASS: BE unit tests SegmentIteratorScoreCommonExprTest, SegmentIteratorApplyIndexExprTest and VirtualSlotRefTest (31 tests); clang-format 16 on the changed BE files.
  • PASS: the 23 regression suites of the branch that use score(), including test_cte_inline_virtual_column, infer_match_predicate, test_score_filter_usage and test_score_filter_matrix, with unchanged .out files.

🤖 Generated with Claude Code

… equalities

### What problem does this PR solve?

Related PR: apache#69419

Problem Summary: Backport apache#69419 to branch-4.2. Predicate inference
copied a predicate on one column to every column that is equal to it,
also when the predicate contained MATCH, multi_match or SEARCH. Their
result depends on the inverted index of the column, not only on its
value: with c1 = c2 and different parsers on the two columns, the copy
removed matching rows, and with the same index it doubled score().
InferPredicateByReplace.infer now skips every input that contains Match,
MultiMatch, Search or SearchExpression.

The branch does not have the NoneMovableFunction check that master has
next to the new check, so only the new check is added. The test imports
SearchDslParser from its package on the branch.

### Release note

Fix wrong results and scores when predicate inference copied a MATCH,
multi_match or SEARCH predicate to an equal column.

### Check List (For Author)

- Test: Includes the unit and regression tests of apache#69419; results are
  recorded in the pull request.
- Behavior changed: Yes. Predicate inference no longer copies a predicate
  that contains MATCH, multi_match or SEARCH to an equal column.
- Does this need documentation: No.

Source-PR: apache#69419
Source-Head: 9e661c8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airborne12
airborne12 requested a review from yiguolei as a code owner October 24, 2026 05:16
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

@yiguolei
yiguolei merged commit 60ed101 into apache:branch-4.2 Oct 24, 2026
29 of 30 checks passed
@airborne12
airborne12 deleted the backport/69419-branch-4.2 branch October 25, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants