Repository navigation
Commit 9e661c8
[fix](nereids) Do not infer multi_match predicates across column equalities
### What problem does this PR solve?
Issue Number: N/A
Related PR: apache#69419
Problem Summary:
multi_match runs its query through the inverted index of its column, like
MATCH, so its result depends on that index and not only on the value of
the column. Predicate inference still copied it to an equal column:
SELECT id FROM infer_match_predicate_parser
WHERE c1 = c2
AND (multi_match(c1, 'any', 'apple') OR multi_match(c1, 'any', 'pear'));
added the same OR over c2. c2 has an index without a parser, so the copy
dropped row 1 ('apple red'). InferPredicateByReplace now also skips the
inputs that contain MultiMatch.
### Release note
Fix incorrect rows when equality inference copies a multi_match predicate
to an equal column.
### Check List (For Author)
- Test:
- InferPredicateByReplaceTest adds multi_match to the shapes of the
MATCH and SEARCH cases. InferPredicateByReplaceTest,
InferPredicatesTest and UnequalPredicateInferTest pass (139 tests).
Checkstyle passes.
- Regression test: infer_match_predicate adds the query above, which
returns row 1; its .out was generated by the framework.
- Behavior changed: Yes. Predicate inference no longer copies a predicate
that contains multi_match to an equal column.
- Does this need documentation: No.
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 4c70c72 commit 9e661c8
4 files changed
Lines changed: 12 additions & 2 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/nereids/rules/rewrite
- test/java/org/apache/doris/nereids/rules/rewrite
- regression-test
- data/nereids_rules_p0/infer_predicate
- suites/nereids_rules_p0/infer_predicate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
243 | | - | |
244 | | - | |
| 244 | + | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
0 commit comments