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


##########
be/src/storage/segment/segment.cpp:
##########
@@ -285,6 +346,24 @@ Status Segment::new_iterator(SchemaSPtr schema, const 
StorageReadOptions& read_o
         }
     }
 
+    // Segment-level expr-zonemap runs before SegmentIterator can rebind 
storage expressions to
+    // the reader schema. Only apply it when scan tuple slot ordinals already 
match this schema.

Review Comment:
   This segment-level pruning is still using the original scan-tuple slot 
ordinals. `build_segment_zonemap_context()` maps `collect_slot_column_ids()` 
through `schema.column_id(slot_index)`, but the expressions are only 
cloned/rebound later in `SegmentIterator::_construct_compound_expr_context()`. 
The new rebinding helper explicitly says AGG_KEYS and non-MOW UNIQUE_KEYS 
readers can expand the reader schema so the scan tuple ordinal is not the 
runtime reader-block ordinal. For those tables, a predicate on scan slot 0 can 
be evaluated here against `schema.column_id(0)` for a different column and skip 
an entire segment that actually has matching rows. Please either run this 
segment-level expr-zonemap pass on cloned/rebound expressions, or gate it to 
the key/table modes where the scan tuple layout is guaranteed to match the 
reader schema.



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