yiguolei commented on code in PR #51271: URL: https://github.com/apache/doris/pull/51271#discussion_r2108080386
########## be/src/olap/rowset/segment_v2/column_reader.cpp: ########## @@ -829,6 +832,65 @@ Status ColumnReader::new_struct_iterator(ColumnIterator** iterator, return Status::OK(); } +Status ColumnReader::merge_zone_maps(const std::vector<ZoneMapPB>& zone_maps, + const FieldType field_type, const int32_t field_length, + ZoneMapPB& zone_map) { + std::unique_ptr<WrapperField> min_value, max_value; + for (const auto& zone_map_ : zone_maps) { + if (zone_map_.has_pass_all() && zone_map_.pass_all()) { + zone_map.set_pass_all(true); + break; + } + + if (zone_map_.has_has_null() && zone_map_.has_null()) { + zone_map.set_has_null(true); + } + + if (!zone_map_.has_not_null()) { + continue; + } + + std::unique_ptr<WrapperField> min; + std::unique_ptr<WrapperField> max; + + RETURN_IF_ERROR(_parse_zone_map(zone_map_, field_type, field_length, min, max)); + + if (!min_value || min_value->cmp(min.get()) > 0) { + min_value = std::move(min); + } + + if (!max_value || max_value->cmp(max.get()) < 0) { + max_value = std::move(max); + } + + zone_map.set_has_not_null(true); + } + + if (min_value) { + *(zone_map.mutable_min()) = min_value->to_string(); + } + if (max_value) { + *(zone_map.mutable_max()) = max_value->to_string(); + } + + return Status::OK(); +} + +bool ColumnReader::match_zone_map_condition(const AndBlockColumnPredicate* predicate, + const FieldType field_type, const int32_t field_length, + const ZoneMapPB& zone_map) { + if (zone_map.has_pass_all() && zone_map.pass_all()) { Review Comment: 这里为什么要加这个判断?? 我看底下的_zone_map_match_condition 也做了这个判断了? 我们是为了避免889 行无效的解析性能吗? -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org