yangzhg commented on a change in pull request #5983: URL: https://github.com/apache/incubator-doris/pull/5983#discussion_r647123074
########## File path: be/src/olap/column_vector.h ########## @@ -181,14 +216,30 @@ class ArrayColumnVectorBatch : public ColumnVectorBatch { // Get thr idx's cell_ptr for write uint8_t* mutable_cell_ptr(size_t idx) override { return reinterpret_cast<uint8*>(&_data[idx]); } - size_t item_offset(size_t idx) const { return _item_offsets[idx]; } + size_t item_offset(size_t idx) const { + return *(_offsets->scalar_cell_ptr(idx)); + } - // From `start_idx`, put `size` ordinals to _item_offsets + // From `start_idx`, change `size` size to offset // Ex: - // original _item_offsets: 0 3 5 9; ordinals to be added: 100 105 111; size: 3; satart_idx: 3 - // --> _item_offsets: 0 3 5 (9 + 100 - 100) (9 + 105 - 100) (9 + 111 - 100) - // _item_offsets becomes 0 3 5 9 14 20 - void put_item_ordinal(segment_v2::ordinal_t* ordinals, size_t start_idx, size_t size); + // start_idx = 3, size = 2 + // + // before change: + // start_idx + // | + // _offsets: 0 3 5 2 1 + // + // after change: + // _offsets: 0 3 5 7 8 + void change_sizes_to_offsets(size_t start_idx, size_t size); Review comment: Please reorganize this comment -- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org