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


##########
be/src/format_v2/table_reader.h:
##########
@@ -417,12 +418,20 @@ class TableReader {
         DORIS_CHECK(can_filter_all != nullptr);
         *can_filter_all = false;
         for (const auto& table_filter : _table_filters) {
-            if (table_filter.conjunct == nullptr ||
-                // RuntimeFilterExpr does not implement execute_column_impl(); 
it is evaluated by
-                // the row-level filter path through execute_filter(). 
Constant split pruning uses
-                // VExprContext::execute() on a one-row synthetic block, so 
runtime filters must not
-                // be pre-executed here even when their referenced slot maps 
to a constant value.
-                table_filter.conjunct->root()->is_rf_wrapper() ||
+            if (table_filter.conjunct == nullptr) {
+                continue;
+            }
+            // Constant pruning must preserve a safe prefix of the row-level 
conjunct order. Once
+            // an unsafe predicate is reached, evaluating any later constant 
predicate could hide
+            // its error or other row-level behavior by pruning the split 
first.
+            if (!_is_safe_to_pre_execute(table_filter.conjunct)) {

Review Comment:
   The safe-prefix check is being applied after `_conjuncts` has already been 
reduced to `_table_filters`, so it cannot see unsafe conjuncts that reference 
no table slots. `build_table_filters_from_conjunct()` only pushes a filter when 
`collect_global_indices()` is non-empty, but row-level filtering still runs the 
original conjunct list in order in `Scanner::_filter_output_block()`. For 
example, with `[assert_true(false), part > 10]` on a split whose partition 
value is `part = 7`, the slotless `assert_true` is absent from 
`_table_filters`; this loop then evaluates the later constant partition 
predicate and prunes the split before the row-level error can be raised. Please 
preserve the prefix over the original conjunct list, or otherwise record 
slotless unsafe conjuncts as barriers before evaluating later constant-only 
filters.
   



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