gaodayue commented on a change in pull request #2050: segment_v2: Support 
bitmap index build
URL: https://github.com/apache/incubator-doris/pull/2050#discussion_r340444141
 
 

 ##########
 File path: be/src/olap/rowset/segment_v2/binary_plain_page.h
 ##########
 @@ -123,13 +136,26 @@ class BinaryPlainPageBuilder : public PageBuilder {
     }
 
 private:
+    Status _get_value_at(void* value, size_t idx) const {
+        if (_offsets.size() == 0) {
+            return Status::NotFound("page is empty");
+        }
+        size_t value_size = (idx < _offsets.size() - 1) ?
+            _offsets[idx + 1] - _offsets[idx] : _last_value_size;
 
 Review comment:
   Right now each item's start offset is stored in _offsets[item_idx]. To get 
the size of last item, there are two ways depending on whether we're building 
the page or we have built the page
   
   - When the page is being built, `add()` should remember the size of last 
value in `_last_value_size`
   - When the page has been built, it can be computed as `trailer_start_offset 
- offsets[num_entries - 1]`

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