gaodayue commented on a change in pull request #1633: add zone map page(#1390)
URL: https://github.com/apache/incubator-doris/pull/1633#discussion_r314976304
 
 

 ##########
 File path: be/src/olap/rowset/segment_v2/column_writer.cpp
 ##########
 @@ -139,8 +153,19 @@ Status ColumnWriter::_append_data(const uint8_t** ptr, 
size_t num_rows) {
             _null_bitmap_builder->add_run(false, num_written);
         }
 
-        // TODO(zc): update statistics for this page
-
+        if (_opts.need_zone_map) {
+            for (int i = 0; i < num_written; ++i) {
+                if (!_page_min_value->is_null()
+                        && 
_page_min_value->field()->compare(_page_min_value->cell_ptr(), start_ptr) > 0) {
+                    _page_min_value->copy(start_ptr);
 
 Review comment:
   If values of the column are mostly in ascending or descending order, this 
would lead to too many memcpy, which is very inefficient. Please leave a TODO 
here, so we can investigate how to avoid value copy (especially for string) in 
the future.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to