github-actions[bot] commented on code in PR #67642:
URL: https://github.com/apache/doris/pull/67642#discussion_r4023387359
##########
be/src/storage/segment/segment.cpp:
##########
@@ -143,8 +143,14 @@ Status build_segment_zonemap_context(Segment* segment,
const ReadSchema& schema,
return Status::OK();
}
-// The statistics iterator answers pushed-down aggregates from the segment
zone maps alone. An
-// invalid zone map has no min/max to answer with, so the caller has to read
the data instead.
+// Whether to force MIN/MAX onto the zone map when its bound is not a value
the data holds now: a
+// cut string bound, or one covering rows a delete predicate removed.
Statistics collection sets it.
+// MIN/MAX is the only aggregate this can force, because it is the only one
that reads the bounds.
+bool pushdown_zonemap_minmax_forced(const StorageReadOptions& read_options) {
+ return read_options.push_down_agg_type_opt == TPushAggOp::MINMAX &&
+
read_options.runtime_state->query_options().force_pushdown_zonemap_minmax;
Review Comment:
[P1] Preserve old-FE behavior when the force bit is absent
During the supported BE-first rolling upgrade, an old FE cannot serialize
field 1006. Its statistics context still enables string MIN/MAX pushdown, but
this reads the missing field as `false`, and the later exactness check rejects
every 512-byte cut bound. An internal ANALYZE over STRING or wide VARCHAR that
previously answered from segment zone maps will therefore full-scan the table
until the FE tier is upgraded. Please distinguish an absent field with
`__isset.force_pushdown_zonemap_minmax` and preserve the legacy opted-in path
(while retaining its delete/`pass_all` guards); a present `false` and old-FE
plans that did not require the legacy opt-in, such as VARCHAR(512), should keep
the new exact fallback.
--
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]