github-actions[bot] commented on code in PR #63389:
URL: https://github.com/apache/doris/pull/63389#discussion_r3295673162
##########
be/src/storage/segment/segment.cpp:
##########
@@ -290,6 +344,21 @@ Status Segment::new_iterator(SchemaSPtr schema, const
StorageReadOptions& read_o
}
}
Review Comment:
This whole-segment expr-zonemap pruning can use the wrong column on
AGG/UNIQUE-MOR readers because `read_options.common_expr_ctxs_push_down` still
contains scan-tuple slot ordinals here, but `schema` is the rowset reader
schema. The PR already handles this later in
`SegmentIterator::_init_common_expr_ctxs()` with
`rebind_storage_exprs_to_reader_schema()` because these layouts can diverge.
For example, on an AGG_KEYS table `(k1, k2, v)`, a query that only
returns/pushes an expression on `k2` can have the slot ref at scan ordinal 0
while the reader schema still has `k1` at position 0 for merge/aggregation.
This helper then reads `schema.column_id(0)` and evaluates the `k2` predicate
against `k1`'s segment zonemap; if `k1`'s min/max is disjoint, the entire
segment can be incorrectly replaced with `EmptySegmentIterator` even though
matching `k2` rows exist. Please either rebind cloned expressions before this
segment-level evaluation (same mapping as `SegmentIterator`) or skip this who
le-segment expr-zonemap path when the storage expression slot layout is not
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]