LuciferYang commented on code in PR #67774:
URL: https://github.com/apache/doris/pull/67774#discussion_r4145427569


##########
be/src/exprs/function/functions_comparison.h:
##########
@@ -734,8 +811,11 @@ class FunctionComparison : public IFunction {
     }
 
     bool can_evaluate_zonemap_filter(const VExprSPtrs& arguments) const 
override {
-        return comparison_zonemap_detail::op_from_name(name).has_value() &&
-               comparison_zonemap_detail::can_evaluate(arguments);
+        if (!comparison_zonemap_detail::op_from_name(name).has_value()) {
+            return false;
+        }
+        return comparison_zonemap_detail::can_evaluate(arguments) ||
+               comparison_zonemap_detail::can_evaluate_slot_slot(arguments);

Review Comment:
   These three columns are now excluded from the expression zone-map pruning. 
`db533f8` adds `Segment::is_read_time_substituted_col` and gates 
`__DORIS_VERSION_COL__` / `__DORIS_COMMIT_TSO_COL__` / `__DORIS_BINLOG_TSO__` 
out of both producers by read-schema ordinal: `build_segment_zonemap_context` 
(segment) and `_apply_expr_zonemap_to_row_ranges` (page). Regression in 
`aced5404`.
   
   The remaining case you point at is a different path, not the expression 
pruning this PR adds: a bare `__DORIS_VERSION_COL__ = <version>` becomes a 
ColumnPredicate that `Segment::new_iterator` prunes against the stored `[0,0]` 
before `SegmentIterator` substitutes the rowset version. That one is resolved 
centrally by #65684, which reads const columns through `ConstantColumnReader` 
and exposes the substituted `[v,v]` zone map on every read path, including the 
ColumnPredicate path. This PR keeps the conservative exclusion for now; once 
#65684 lands, the exclusion can be dropped so these columns prune on their real 
value.



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