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


##########
be/src/exprs/vectorized_fn_call.cpp:
##########
@@ -683,12 +683,13 @@ bool 
VectorizedFnCall::is_safe_to_execute_on_selected_rows() const {
                                                                     
"is_null_pred",
                                                                     
"is_not_null_pred",
                                                                     
"element_at",
-                                                                    
"struct_element"};
+                                                                    
"struct_element",
+                                                                    
"array_contains"};

Review Comment:
   [P1] Keep unsupported array_contains types outside the safe prefix
   
   This name-only opt-in is broader than the function's executable domain. 
Nereids accepts matching complex element types (for example `ARRAY<ARRAY<INT>>` 
with an `ARRAY<INT>` needle), but `_execute_dispatch()` only handles the 
scalar/string families in `DispatchDataTypeMask::ALL` and returns a runtime 
error for ARRAY/MAP/STRUCT elements. Marking all such calls safe lets 
TableReader's metadata-pruning prefix cross that error-producing conjunct; a 
later scalar ZoneMap predicate can then drop the Row Group before residual 
execution and turn the error into an empty result. Please restrict safety to 
supported prepared element types (or reject/implement the complex signatures 
earlier) and add a safe-prefix regression that preserves this error.



##########
be/src/format_v2/parquet/parquet_statistics.cpp:
##########
@@ -863,6 +863,31 @@ bool has_expr_zonemap_filter(const 
format::FileScanRequest& request, const Runti
     return has_variant_shredded_filter(request);
 }
 
+bool can_evaluate_native_page_index(const VExprSPtr& expr) {
+    if (expr == nullptr || !expr->can_evaluate_zonemap_filter()) {
+        return false;
+    }
+    if (expr->op() == TExprOpcode::COMPOUND_AND) {
+        return std::ranges::any_of(expr->children(), 
can_evaluate_native_page_index);
+    }
+    if (expr->op() == TExprOpcode::COMPOUND_OR) {
+        return !expr->children().empty() &&
+               std::ranges::all_of(expr->children(), 
can_evaluate_native_page_index);
+    }
+    const auto probe = 
expr_zonemap::extract_zonemap_filter_predicate_probe(expr);
+    return probe.has_value() && probe->path.empty();

Review Comment:
   [P1] Preserve Page Index pruning for runtime-filter wrappers
   
   This new gate rejects every `RuntimeFilterExpr`-only request even when its 
wrapped scalar predicate is Page-Index evaluable. `RuntimeFilterExpr` keeps the 
predicate in `_impl` and delegates `can_evaluate_zonemap_filter()`, evaluation, 
and slot collection, but it does not populate the inherited `_children`; the 
probe extractor uses non-virtual `get_num_children()`/`get_child()` and 
therefore returns no probe for the wrapper. This makes the gate false and 
`finalize_native_row_group_read_plan()` skips loading ColumnIndex/OffsetIndex, 
although the downstream selector already supports the delegated runtime filter. 
Please unwrap `get_impl()` for capability/path classification (while retaining 
the wrapper for actual evaluation) and add an RF-only 
production-gate/range-selection 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