imay commented on a change in pull request #1633: add zone map page(#1390) URL: https://github.com/apache/incubator-doris/pull/1633#discussion_r316552195
########## File path: be/src/olap/rowset/segment_v2/column_reader.cpp ########## @@ -156,18 +160,69 @@ Status ColumnReader::read_page(const PagePointer& pp, PageHandle* handle) { return Status::OK(); } +void ColumnReader::get_row_ranges_by_zone_map(CondColumn* cond_column, RowRanges* row_ranges) { + std::vector<uint32_t> page_indexes; + _get_filtered_pages(cond_column, &page_indexes); + _calculate_row_ranges(page_indexes, row_ranges); +} + +void ColumnReader::_get_filtered_pages(CondColumn* cond_column, std::vector<uint32_t>* page_indexes) { + FieldType type = _type_info->type(); + const std::vector<ZoneMapPB>& zone_maps = _column_zone_map->get_column_zone_map(); + int32_t page_size = _column_zone_map->num_pages(); + std::unique_ptr<WrapperField> min_value(WrapperField::create_by_type(type)); + std::unique_ptr<WrapperField> max_value(WrapperField::create_by_type(type)); + for (int32_t i = 0; i < page_size; ++i) { + min_value->from_string(zone_maps[i].min()); + max_value->from_string(zone_maps[i].max()); + // for compatible original Cond eval logic + // TODO(hkp): optimize OlapCond + if (zone_maps[i].null_flag() && !zone_maps[i].non_null_flag()) { Review comment: you should keep compatible with old. when null_flag() is true, you should set min_value to null ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org For additional commands, e-mail: dev-h...@doris.apache.org