yiguolei commented on code in PR #51271:
URL: https://github.com/apache/doris/pull/51271#discussion_r2119323274


##########
be/src/olap/rowset/segment_v2/segment.cpp:
##########
@@ -1231,4 +1233,59 @@ StoragePageCache::CacheKey 
Segment::get_segment_footer_cache_key() const {
                                       _file_reader->size() - 12);
 }
 
+std::map<uint32_t, Segment::ZoneMapInfo> Segment::get_zone_maps() {
+    if (config::cache_zone_map_max_columns_count <= 0) {
+        return {};
+    }
+
+    std::shared_ptr<SegmentFooterPB> footer_pb;
+    try {
+        auto st = _get_segment_footer(footer_pb, nullptr);
+        if (!st.ok()) {
+            LOG(INFO) << "cannot get footer from segment: " << _segment_id
+                      << ", rowset: " << _rowset_id << ", error: " << 
st.to_string();
+            return {};
+        }
+    } catch (const std::exception& e) {
+        LOG(WARNING) << "Failed to get segment footer for segment: " << 
_segment_id
+                     << ", rowset: " << _rowset_id << ", error: " << e.what();
+        return {};
+    }
+
+    std::map<uint32_t, ZoneMapInfo> zone_maps;
+
+    const auto& schema_columns = _tablet_schema->columns();
+    const auto pb_columns_count = footer_pb->columns().size();
+    if (pb_columns_count <= 0) {
+        return {};

Review Comment:
   直接return error status,这不是一个正常现象



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

Reply via email to