BiteTheDDDDt opened a new pull request, #62027:
URL: https://github.com/apache/doris/pull/62027

   This pull request addresses a bug in the OLAP scan operator where `IN_LIST` 
predicates could be incorrectly erased when both `MINMAX` and `IN` runtime 
filters targeted the same key column, and the number of `IN` values exceeded 
the maximum allowed for pushdown. The changes ensure that `IN_LIST` predicates 
are preserved in such cases, preventing incorrect query results. Additionally, 
a regression test is added to verify the fix.
   
   **Bug fix in predicate handling:**
   
   * Modified the logic in `_build_key_ranges_and_filters()` within 
`olap_scan_operator.cpp` to ensure that `IN_LIST` predicates are not erased 
when the key range is a scope range (e.g., `>= X AND <= Y`) and the `IN` 
filter's value count exceeds `max_pushdown_conditions_per_column`. This 
preserves filtering semantics that are not captured by the scope range. 
[[1]](diffhunk://#diff-3ddc75656071d9c0e6b0be450e152a1c94559f7e70ea820e7f0c80a7078e3292R972)
 
[[2]](diffhunk://#diff-3ddc75656071d9c0e6b0be450e152a1c94559f7e70ea820e7f0c80a7078e3292R986)
 
[[3]](diffhunk://#diff-3ddc75656071d9c0e6b0be450e152a1c94559f7e70ea820e7f0c80a7078e3292L986-R1013)
   
   * Enhanced the profiling output in `_process_conjuncts()` to accurately 
reflect the set of predicates that will reach the storage layer after key range 
and filter construction. This helps with debugging and verification of 
predicate pushdown.
   
   **Testing and regression coverage:**
   
   * Added a new regression test 
`test_rf_in_list_not_erased_by_scope_range.groovy` to verify that `IN_LIST` 
predicates are not incorrectly erased when both `MINMAX` and `IN` filters are 
present and the `IN` list is too large to be absorbed into the key range.
   
   * Added the corresponding expected output file for the new regression test.


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