github-actions[bot] commented on code in PR #69419:
URL: https://github.com/apache/doris/pull/69419#discussion_r4347081884


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/InferPredicateByReplace.java:
##########
@@ -237,7 +240,9 @@ public static Set<Expression> infer(Set<Expression> inputs) 
{
         Map<Expression, Set<Expression>> exprPredicates = new HashMap<>();
         for (Expression input : inputs) {
             // Inference can evaluate a predicate on rows that never reach its 
original filter.
-            if (input.anyMatch(expr -> expr instanceof NoneMovableFunction
+            // MATCH and SEARCH depend on column indexes, and copies can 
change score().
+            if (input.containsType(Match.class, Search.class, 
SearchExpression.class)

Review Comment:
   [P2] Include multi_match in the index-dependent exclusion
   
   `MultiMatch` is a separate deterministic scalar function, so it passes this 
check even though its result also depends on the selected column index. On the 
new parser-regression table:
   
   ```sql
   SELECT id FROM infer_match_predicate_parser
   WHERE c1 = c2
     AND (multi_match(c1, 'any', 'apple') OR multi_match(c1, 'any', 'pear'));
   ```
   
   The reduced input is `Filter[c1=c2, Or(MultiMatch(c1), MultiMatch(c1))] -> 
Scan`. `visitOr` registers `c1`, and `getEqualSetAndDoReplace` adds the same OR 
over `c2`. `FunctionMultiMatch::evaluate_inverted_index` queries each column's 
own index: the English-index predicate accepts id=1 (`'apple red'`), while the 
inferred parserless-column predicate rejects it and removes the row. This 
leaves a parallel instance of the wrong-row bug unfixed. Include `MultiMatch` 
in the exclusion and add a regression. This scalar builtin is distinct from the 
wrapped `Match` covered by the existing review thread.



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