amorynan commented on code in PR #17330:
URL: https://github.com/apache/doris/pull/17330#discussion_r1125801870


##########
be/src/olap/rowset/segment_v2/column_reader.cpp:
##########
@@ -680,9 +720,51 @@ Status StructFileColumnIterator::read_by_rowids(const 
rowid_t* rowids, const siz
 }
 
 
////////////////////////////////////////////////////////////////////////////////
+Status OffsetFileColumnIterator::init(const ColumnIteratorOptions& opts) {
+    RETURN_IF_ERROR(_offset_iterator->init(opts));
+    return Status::OK();
+}
+
+Status OffsetFileColumnIterator::next_batch(size_t* n, 
vectorized::MutableColumnPtr& dst,
+                                            bool* has_null) {
+    RETURN_IF_ERROR(_offset_iterator->next_batch(n, dst, has_null));
+    return Status::OK();
+}
+
+Status OffsetFileColumnIterator::_peek_one_offset(ordinal_t* offset) {
+    if (_offset_iterator->get_current_page()->has_remaining()) {
+        PageDecoder* offset_page_decoder = 
_offset_iterator->get_current_page()->data_decoder;
+        vectorized::MutableColumnPtr offset_col = 
vectorized::ColumnUInt64::create();
+        size_t n = 1;
+        RETURN_IF_ERROR(offset_page_decoder->peek_next_batch(&n, offset_col)); 
// not null
+        DCHECK(offset_col->size() == 1);
+        *offset = offset_col->get_uint(0);
+    } else {
+        *offset = 
_offset_iterator->get_current_page()->next_array_item_ordinal;
+    }
+    return Status::OK();
+}
 
+Status OffsetFileColumnIterator::_calculate_offsets(

Review Comment:
   it calls _peek_one_offset() which use _offset_iterator here



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